summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
279c9e0)
It seems possible that a signal coming in at the wrong time could confuse
this code. It's always best to loop on EINTR.
pid = fork();
if (pid > 0) {
/* Running in parent process. */
pid = fork();
if (pid > 0) {
/* Running in parent process. */
char c;
close(fds[1]);
fatal_signal_fork();
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) {
# Running in parent process.
os.close(wfd)
ovs.fatal_signal.fork()
# Running in parent process.
os.close(wfd)
ovs.fatal_signal.fork()
- try:
- s = os.read(rfd, 1)
- except OSError, e:
- s = ""
+ while True:
+ try:
+ s = os.read(rfd, 1)
+ error = 0
+ except OSError, e:
+ s = ""
+ error = e.errno
+ if error != errno.EINTR:
+ break
if len(s) != 1:
retval, status = _waitpid(pid, 0)
if (retval == pid and
if len(s) != 1:
retval, status = _waitpid(pid, 0)
if (retval == pid and