added PROC_LOADAVG compilation option
authorthib <thib>
Mon, 4 Sep 2000 13:08:15 +0000 (13:08 +0000)
committerthib <thib>
Mon, 4 Sep 2000 13:08:15 +0000 (13:08 +0000)
config.h.in
database.c
fileconf.c

index c9e8351266d3d1ac9d607d4a62864ab40d8a661e..b958d9b1f9980b5c22d7dae18bc5100a5eee276b 100644 (file)
@@ -21,7 +21,7 @@
  *  `LICENSE' that comes with the fcron source distribution.
  */
 
- /* $Id: config.h.in,v 1.14 2000-08-29 18:01:39 thib Exp $ */
+ /* $Id: config.h.in,v 1.15 2000-09-04 13:08:15 thib Exp $ */
 
 
 /* *********************************************************** */
 /* (they are overridden by Makefile's value ) */
 
 #ifndef VERSION
-#define VERSION        "1.0.0"   /* default version if not defined in Makefile */
+#define VERSION        "1.0.0" /* default version if not defined in Makefile */
+#endif
+
+#ifndef SENDMAIL        /* mail command location */ 
+#define SENDMAIL       "/usr/lib/sendmail"
 #endif
 
 #ifndef FCRONTABS        /* directory where is stored users' fcrontabs */
 #define ETC             "/etc/"
 #endif
 
+#ifndef PROC_LOADAVG    /* do we have a mounted procfs with loadavg file on
+                        * this system ? */
+#define PROC_LOADAVG    1
+#endif
+
 #ifndef PROC            /* directory where is mounted the procfs */
 #define PROC            "/proc/"
 #endif
@@ -78,8 +87,6 @@
 
 #define FCRON_DENY       "fcron.deny"
 
-#define SENDMAIL       "/usr/lib/sendmail" /* mail command */
-
 #define SENDMAIL_ARGS  "-Ffcron", "-odi"   /* args of mail command */
 
 #define EDITOR          "/usr/bin/vi"       /* default editor */
index a5d99c4ec46ae15501fc5aa911703f71eb2a4f04..dedf8e4e02a1875ee33bd9f89f123aff7f8cc9dc 100644 (file)
@@ -22,7 +22,7 @@
  *  `LICENSE' that comes with the fcron source distribution.
  */
 
- /* $Id: database.c,v 1.22 2000-09-03 19:03:10 thib Exp $ */
+ /* $Id: database.c,v 1.23 2000-09-04 13:10:13 thib Exp $ */
 
 #include "fcron.h"
 
@@ -747,6 +747,13 @@ check_lavg(time_t lim)
      * and return the time to sleep */
 {
     time_t tts = time_to_sleep(lim);
+
+#if PROC_LOADAVG == 0
+    while ( lavg_num > 0 )
+       run_lavg_job(0);
+    return tts;
+#endif /* PROC_LOADAVG = 0 */ 
+
     register int i = 0;
     short int l_avg[3];
 
index f04fa384fce56695c852a0688b8099187479be10..eaeb4d0bf55f264db64fe492ba4b96952cd3cb15 100644 (file)
@@ -22,7 +22,7 @@
  *  `LICENSE' that comes with the fcron source distribution.
  */
 
- /* $Id: fileconf.c,v 1.15 2000-08-29 18:03:03 thib Exp $ */
+ /* $Id: fileconf.c,v 1.16 2000-09-04 13:09:21 thib Exp $ */
 
 #include "fcrontab.h"
 
@@ -537,6 +537,10 @@ read_opt(char *ptr, CL *cl)
                Handle_err;
            cl->cl_lavg[2] = i;
            set_lavg(cl->cl_option);
+#if PROC_LOADAVG == 0
+           warn("As fcron has been compiled with no procfs support,\n"
+                "you will not be able to use the lavg* options");
+#endif /* PROC_LOADAVG = 0 */ 
            if (debug_opt)
                fprintf(stderr, "  Opt : 'lavg15' %d\n", i);
        }
@@ -546,6 +550,10 @@ read_opt(char *ptr, CL *cl)
                Handle_err;
            cl->cl_lavg[0] = i;
            set_lavg(cl->cl_option);
+#if PROC_LOADAVG == 0
+           warn("As fcron has been compiled with no procfs support,\n"
+                "you will not be able to use the lavg* options");
+#endif /* PROC_LOADAVG = 0 */ 
            if (debug_opt)
                fprintf(stderr, "  Opt : 'lavg1' %d\n", i);
        }
@@ -555,6 +563,10 @@ read_opt(char *ptr, CL *cl)
                Handle_err;
            cl->cl_lavg[1] = i;
            set_lavg(cl->cl_option);
+#if PROC_LOADAVG == 0
+           warn("As fcron has been compiled with no procfs support,\n"
+                "you will not be able to use the lavg* options");
+#endif /* PROC_LOADAVG = 0 */ 
            if (debug_opt)
                fprintf(stderr, "  Opt : 'lavg5' %d\n", i);
        }
@@ -564,6 +576,10 @@ read_opt(char *ptr, CL *cl)
                Handle_err;
            cl->cl_lavg[2] = i;
            set_lavg(cl->cl_option);
+#if PROC_LOADAVG == 0
+           warn("As fcron has been compiled with no procfs support,\n"
+                "you will not be able to use the lavg* options");
+#endif /* PROC_LOADAVG = 0 */ 
            if (debug_opt)
                fprintf(stderr, "  Opt : 'lavg15' %d\n", i);
        }