dhcp: ensure that dhcp client is exited
On restart ensure that the client we're trying to kill has actually exited even if it's not our child.
This commit is contained in:

committed by
Dan Williams

parent
3951942fa1
commit
92b58e56f5
@@ -156,12 +156,16 @@ stop_process (GPid pid, const char *iface)
|
||||
|
||||
if (ret == -1) {
|
||||
/* Child already exited */
|
||||
if (errno == ECHILD)
|
||||
if (errno == ECHILD) {
|
||||
/* Was it really our child and it exited? */
|
||||
if (kill (pid, 0) < 0 && errno == ESRCH)
|
||||
break;
|
||||
} else {
|
||||
/* Took too long; shoot it in the head */
|
||||
i = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
g_usleep (G_USEC_PER_SEC / 5);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user