mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 01:58:05 +02:00
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:
parent
3951942fa1
commit
92b58e56f5
1 changed files with 8 additions and 4 deletions
|
|
@ -156,11 +156,15 @@ 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;
|
||||||
|
} else {
|
||||||
|
/* Took too long; shoot it in the head */
|
||||||
|
i = 0;
|
||||||
break;
|
break;
|
||||||
/* Took too long; shoot it in the head */
|
}
|
||||||
i = 0;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
g_usleep (G_USEC_PER_SEC / 5);
|
g_usleep (G_USEC_PER_SEC / 5);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue