]> git.ipfire.org Git - thirdparty/fcron.git/commitdiff
check each signal at each cycle (this is needed because of serialize :
authorThibault Godouet <yo8192@users.noreply.github.com>
Wed, 28 Jun 2000 16:27:49 +0000 (16:27 +0000)
committerThibault Godouet <yo8192@users.noreply.github.com>
Wed, 28 Jun 2000 16:27:49 +0000 (16:27 +0000)
we may get a SIGHUP during execution of several serial jobs,
in which case the SIGHUP was taken into account after the next sleep)

fcron.c

diff --git a/fcron.c b/fcron.c
index 1ebfc1f330e91042b44ae01765a1009cb3239c97..6b292b2683616acb44737f90584994b4d9f61dc2 100644 (file)
--- a/fcron.c
+++ b/fcron.c
  *  `LICENSE' that comes with the fcron source distribution.
  */
 
- /* $Id: fcron.c,v 1.22 2000-06-25 20:00:13 thib Exp $ */
+ /* $Id: fcron.c,v 1.23 2000-06-28 16:27:49 thib Exp $ */
 
 #include "fcron.h"
 
-char rcs_info[] = "$Id: fcron.c,v 1.22 2000-06-25 20:00:13 thib Exp $";
+char rcs_info[] = "$Id: fcron.c,v 1.23 2000-06-28 16:27:49 thib Exp $";
 
 void main_loop(void);
 void info(void);
@@ -427,7 +427,7 @@ void main_loop()
     time_t save;               /* time remaining until next save */
     struct timeval tv;         /* we use usec field to get more precision */
     time_t stime;          /* time to sleep until next job
-                               * execution */
+                           * execution */
 
     debug("Entering main loop");
 
@@ -456,7 +456,7 @@ void main_loop()
            wait_chld();
            sig_chld = 0;
        }
-       else if (sig_conf > 0) {
+       if (sig_conf > 0) {
 
            if (sig_conf == 1)
                /* update configuration */
@@ -467,20 +467,17 @@ void main_loop()
 
            sig_conf = 0;
        }
-       else {
-           debug("\n");
+       debug("\n");
 
-           test_jobs(now);
+       test_jobs(now);
 
-           if ( serial_running == 0)
-               run_serial_job();
-
-           if ( save <= now ) {
-               save = now + SAVE;
-               /* save all files */
-               save_file(NULL, NULL);
-           }
+       if ( serial_running == 0)
+           run_serial_job();
 
+       if ( save <= now ) {
+           save = now + SAVE;
+           /* save all files */
+           save_file(NULL, NULL);
        }
 
        stime = time_to_sleep(save);