* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: fcron.c,v 1.29 2000-09-15 20:17:07 thib Exp $ */
+ /* $Id: fcron.c,v 1.30 2000-09-30 11:55:58 thib Exp $ */
#include "fcron.h"
-char rcs_info[] = "$Id: fcron.c,v 1.29 2000-09-15 20:17:07 thib Exp $";
+char rcs_info[] = "$Id: fcron.c,v 1.30 2000-09-30 11:55:58 thib Exp $";
void main_loop(void);
void check_signal(void);
short int lavg_array_size; /* size of lavg_array */
short int lavg_num; /* number of job being queued */
-struct CL **exe_array; /* jobs which are executed */
+struct exe *exe_array; /* jobs which are executed */
short int exe_array_size; /* size of exe_array */
short int exe_num; /* number of job being executed */
/* initialize exe_array */
exe_num = 0;
exe_array_size = EXE_INITIAL_SIZE;
- if ( (exe_array = calloc(exe_array_size, sizeof(CL *))) == NULL )
+ if ( (exe_array = calloc(exe_array_size, sizeof(struct exe))) == NULL )
die_e("could not calloc exe_array");
/* initialize serial_array */
debug("\n");
test_jobs(now);
- if ( serial_running <= 0)
- run_serial_job();
+ if ( serial_running <= 0)
+ run_serial_job();
if ( save <= now ) {
save = now + SAVE;
* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: fcron.h,v 1.11 2000-09-12 19:52:50 thib Exp $ */
+ /* $Id: fcron.h,v 1.12 2000-09-30 11:56:59 thib Exp $ */
#ifndef __FCRONH__
#define __FCRONH__
#include "getloadavg.h"
#endif
-
/* global variables */
extern time_t now;
extern char debug_opt;
extern short int serial_array_index;
extern short int serial_num;
extern short int serial_running;
-extern struct CL **exe_array;
+extern struct exe *exe_array;
extern short int exe_array_size;
extern short int exe_num;
extern struct lavg *lavg_array;
/* end of conf.c */
/* job.c */
-extern void run_job(CL *line);
+extern void run_job(struct exe *exeent);
/* end of job.c */
* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: job.c,v 1.23 2000-09-13 15:38:48 thib Exp $ */
+ /* $Id: job.c,v 1.24 2000-09-30 11:58:23 thib Exp $ */
#include "fcron.h"
}
void
-run_job(CL *line)
+run_job(struct exe *exeent)
/* fork(), redirect outputs to a temp file, and execl() the task */
{
pid_t pid;
+ CL *line = exeent->e_line;
/* // */
/* debug("run_job"); */
default:
/* parent */
- line->cl_pid = pid;
+ exeent->e_pid = pid;
line->cl_file->cf_running += 1;
- explain("Job `%s' started (pid %d)", line->cl_shell, line->cl_pid);
+ explain("Job `%s' started (pid %d)", line->cl_shell, pid);
}