diff options
author | Thomas Haller <thaller@redhat.com> | 2015-05-03 13:57:16 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-05-05 17:17:41 +0200 |
commit | db87f280f0576180948503f6fafd8d7c51b06ac7 (patch) | |
tree | fd0f9ed356c88b3d9383297efa7e6b7e6b4a94d3 | |
parent | 57518271d69c3bf712a1b8b2c2f2e4669bff31fa (diff) | |
download | NetworkManager-db87f280f0576180948503f6fafd8d7c51b06ac7.tar.gz |
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 22bfe2feb28f748235577da46f7f8a365f4ad607)
-rw-r--r-- | callouts/nm-dispatcher.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/callouts/nm-dispatcher.c b/callouts/nm-dispatcher.c index 0cd2531dda..1ec7611b04 100644 --- a/callouts/nm-dispatcher.c +++ b/callouts/nm-dispatcher.c @@ -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; |