projects
/
NetworkManager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f0c23f
)
dispatcher: repeat waitpid() call on EINTR
author
Thomas Haller
<thaller@redhat.com>
Sun, 3 May 2015 11:57:16 +0000
(13:57 +0200)
committer
Thomas Haller
<thaller@redhat.com>
Tue, 5 May 2015 14:39:18 +0000
(16:39 +0200)
Also, no use of first trying to kill() with signal zero. Just
send SIGKILL right away.
callouts/nm-dispatcher.c
patch
|
blob
|
history
diff --git
a/callouts/nm-dispatcher.c
b/callouts/nm-dispatcher.c
index
6fb40cf
..
77f2153
100644
(file)
--- 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;