]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Don't abort on EINTR select errors
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 14 Jun 2013 10:37:24 +0000 (12:37 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Fri, 14 Jun 2013 10:37:24 +0000 (12:37 +0200)
sched.c

diff --git a/sched.c b/sched.c
index c2758050f820989e5cecc4403334893373b58ef4..7d0cc826cbca0b7ff1002c5df9da7066a0153e29 100644 (file)
--- a/sched.c
+++ b/sched.c
@@ -561,7 +561,7 @@ void
 SCH_MainLoop(void)
 {
   fd_set rd;
-  int status;
+  int status, errsv;
   struct timeval tv, *ptv;
   struct timeval now, cooked;
   double err;
@@ -592,6 +592,7 @@ SCH_MainLoop(void)
     assert(ptv || n_read_fds);
 
     status = select(one_highest_fd, &rd, NULL, NULL, ptv);
+    errsv = errno;
 
     LCL_ReadRawTime(&now);
     LCL_CookTime(&now, &cooked, &err);
@@ -606,7 +607,9 @@ SCH_MainLoop(void)
     last_select_ts_err = err;
 
     if (status < 0) {
-      assert(need_to_exit);
+      if (!need_to_exit && errsv != EINTR) {
+        LOG_FATAL(LOGF_Scheduler, "select() failed : %s", strerror(errsv));
+      }
     } else if (status > 0) {
       /* A file descriptor is ready to read */