about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-02-15 02:43:51 +0000
committerEric Wong <normalperson@yhbt.net>2013-02-15 02:43:51 +0000
commitb7403080f0266ac41cecae80adcfa0391f3f93b7 (patch)
tree67869a501fbddfaaf10cac72980f001b0153af71
parent5629899a12649b9b21f41efc29b92adbd82afe6c (diff)
downloadcmogstored-b7403080f0266ac41cecae80adcfa0391f3f93b7.tar.gz
We need to atomically enable interrupts and sleep with
the same syscall.  Fortunately, using pselect (through
mog_sleep) allows that and is POSIX-compliant, so use
that.
-rw-r--r--cmogstored.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/cmogstored.c b/cmogstored.c
index adad681..3c389bc 100644
--- a/cmogstored.c
+++ b/cmogstored.c
@@ -468,9 +468,7 @@ static void fork_worker(unsigned worker_id)
                 exit(EXIT_SUCCESS);
         } else {
                 syslog(LOG_ERR, "fork() failed: %m, sleeping for 10s");
-                mog_intr_enable();
-                sleep(10);
-                mog_intr_disable();
+                mog_sleep(10);
         }
 }