Remove orphaned wpa_cli control socket on EADDRINUSE
authorJouni Malinen <j@w1.fi>
Sat, 31 Jan 2009 20:22:09 +0000 (22:22 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 31 Jan 2009 20:22:09 +0000 (22:22 +0200)
commit6e488ff03c5af513f7768364f3cdd890ef98b0bd
tree78cda16ff6a007add7390948176e87a71598cd10
parent1c5aeef0c28c113a3643f6a50d0508f6f65c431a
Remove orphaned wpa_cli control socket on EADDRINUSE

If the bind() on /tmp/wpa_ctrl_<pid>_<in-proc-counter> fails with
EADDRINUSE, there is an existing socket file with the name we are trying
to create. Since getpid() is unique, there cannot be another process
using that socket and we can just unlink the file and try again. This
can speed up client connection if wpa_cli is killed without allowing it
to clean up the socket file. [Bug 288]
src/common/wpa_ctrl.c