* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: conf.c,v 1.18 2000-08-22 18:01:30 thib Exp $ */
+ /* $Id: conf.c,v 1.19 2000-08-28 17:52:05 thib Exp $ */
#include "fcron.h"
/* read env variables */
Alloc(env, env_t);
- while( (env->e_name = read_str(ff, buf, sizeof(buf))) != NULL ) {
- env->e_val = read_str(ff, buf, sizeof(buf));
- debug(" Env: '%s=%s'", env->e_name, env->e_val );
+ while( (env->e_val = read_str(ff, buf, sizeof(buf))) != NULL ) {
+ debug(" Env: '%s'", env->e_val );
env->e_next = cf->cf_env_base;
cf->cf_env_base = env;
}
if ( cl->cl_pid == -1 ) {
- cl->cl_pid = 0;
- add_serial_job(cl);
+ if ( is_lavg(cl->cl_option) ) {
+ cl->cl_pid = 0;
+ add_lavg_job(cl);
+ }
+ else {
+ cl->cl_pid = 0;
+ add_serial_job(cl);
+ }
}
-
/* check if the task has not been stopped during execution */
if (cl->cl_pid > 0) {
/* job has been stopped during execution :
/* free last calloc : unused */
free(cl);
-// if (fgets(buf, sizeof(buf), ff) == NULL ||
-// strncmp(buf, "eof\n", sizeof("eof\n")) != 0)
-// error("file '%s' is truncated : you should reinstall it", file_name);
+/* // if (fgets(buf, sizeof(buf), ff) == NULL || */
+/* // strncmp(buf, "eof\n", sizeof("eof\n")) != 0) */
+/* // error("file '%s' is truncated : you should reinstall it",file_name); */
fclose(ff);
cur_env = file->cf_env_base;
while ( (env = cur_env) != NULL ) {
cur_env = env->e_next;
- free(env->e_name);
free(env->e_val);
free(env);
}
fprintf(f, "%ld", now);
/* env variables, */
- for (env = cf->cf_env_base; env; env = env->e_next) {
- fprintf(f, "%s%c", env->e_name, '\0');
+ for (env = cf->cf_env_base; env; env = env->e_next)
fprintf(f, "%s%c", env->e_val, '\0');
- }
+
fprintf(f, "%c", '\0');
/* finally, lines. */
}
-// /* then, write the number of lines to permit to check if the file
-// * is complete (i.e. fcron may has been interrupted during
-// * save process */
-// fprintf(f, "eof\n");
+ /* then, write the number of lines to permit to check if the file
+ * is complete (i.e. fcron may has been interrupted during
+ * save process */
+/* // fprintf(f, "eof\n"); */
fclose(f);