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:
Mikhail Efremov
2010-11-19 16:52:55 -06:00
committed by Dan Williams
parent 3951942fa1
commit 92b58e56f5

View File

@@ -156,12 +156,16 @@ stop_process (GPid pid, const char *iface)
if (ret == -1) { if (ret == -1) {
/* Child already exited */ /* 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; break;
} else {
/* Took too long; shoot it in the head */ /* Took too long; shoot it in the head */
i = 0; i = 0;
break; break;
} }
}
g_usleep (G_USEC_PER_SEC / 5); g_usleep (G_USEC_PER_SEC / 5);
} }