mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-31 09:00:13 +01:00
dispatcher: repeat waitpid() call on EINTR
Also, no use of first trying to kill() with signal zero. Just
send SIGKILL right away.
(cherry picked from commit 22bfe2feb2)
This commit is contained in:
parent
57518271d6
commit
db87f280f0
1 changed files with 6 additions and 3 deletions
|
|
@ -294,9 +294,12 @@ script_timeout_cb (gpointer user_data)
|
|||
|
||||
g_warning ("Script '%s' took too long; killing it.", script->script);
|
||||
|
||||
if (kill (script->pid, 0) == 0)
|
||||
kill (script->pid, SIGKILL);
|
||||
(void) waitpid (script->pid, NULL, 0);
|
||||
kill (script->pid, SIGKILL);
|
||||
again:
|
||||
if (waitpid (script->pid, NULL, 0) == -1) {
|
||||
if (errno == EINTR)
|
||||
goto again;
|
||||
}
|
||||
|
||||
script->error = g_strdup_printf ("Script '%s' timed out.", script->script);
|
||||
script->result = DISPATCH_RESULT_TIMEOUT;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue