diff options
author | Ben Pfaff <blp@nicira.com> | 2011-03-31 09:36:10 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-04-04 10:58:55 -0700 |
commit | af9a144207eb1b4fdfd735b29f90c41f80aa9a2e (patch) | |
tree | f648cd59627a33cb5f6718e0686c36b545353e45 /lib/daemon.c | |
parent | 279c9e030818e039bb1c26be76e2cc1e8f6b13a6 (diff) | |
download | openvswitch-af9a144207eb1b4fdfd735b29f90c41f80aa9a2e.tar.gz |
daemon: Tolerate EINTR in fork_and_wait_for_startup().
It seems possible that a signal coming in at the wrong time could confuse
this code. It's always best to loop on EINTR.
Diffstat (limited to 'lib/daemon.c')
-rw-r--r-- | lib/daemon.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/daemon.c b/lib/daemon.c index 64e2f9e9a..173dabe6f 100644 --- a/lib/daemon.c +++ b/lib/daemon.c @@ -244,11 +244,12 @@ fork_and_wait_for_startup(int *fdp) pid = fork(); if (pid > 0) { /* Running in parent process. */ + size_t bytes_read; char c; close(fds[1]); fatal_signal_fork(); - if (read(fds[0], &c, 1) != 1) { + if (read_fully(fds[0], &c, 1, &bytes_read) != 0) { int retval; int status; |