]> git.ipfire.org Git - thirdparty/fcron.git/commitdiff
support of bootrun and serialize
authorThibault Godouet <yo8192@users.noreply.github.com>
Wed, 21 Jun 2000 09:49:01 +0000 (09:49 +0000)
committerThibault Godouet <yo8192@users.noreply.github.com>
Wed, 21 Jun 2000 09:49:01 +0000 (09:49 +0000)
job.c

diff --git a/job.c b/job.c
index 7063ff093b4e3ec85586c96af81ce5ee30c13397..59c99d93e008acc9f613539abbc7709a538644d3 100644 (file)
--- a/job.c
+++ b/job.c
@@ -22,7 +22,7 @@
  *  `LICENSE' that comes with the fcron source distribution.
  */
 
- /* $Id: job.c,v 1.13 2000-06-21 09:50:09 thib Exp $ */
+ /* $Id: job.c,v 1.12 2000-06-21 09:49:01 thib Exp $ */
 
 #include "fcron.h"
 
@@ -82,6 +82,23 @@ run_job(CL *line)
 
     pid_t pid;
 
+    /* append job to the list of executed job */
+    if ( exe_num >= exe_array_size ) {
+       CL **ptr = NULL;
+       short int old_size = exe_array_size;
+
+       debug("Resizing exe_array");
+       exe_array_size = (exe_array_size + EXE_ARRAY_GROW_SIZE);
+       
+       if ( (ptr = calloc(exe_array_size, sizeof(CL *))) == NULL )
+           die_e("could not calloc exe_array");
+
+       memcpy(ptr, exe_array, (sizeof(CL *) * old_size));
+       free(exe_array);
+       exe_array = ptr;
+    }
+    exe_array[exe_num++] = line;
+
     /* prepare the job execution */
     switch ( pid = fork() ) {
     case -1: