From: Kern Sibbald Date: Sat, 22 Mar 2008 09:05:20 +0000 (+0000) Subject: Keep Schedule run lists in order as suggested by X-Git-Tag: Release-3.0.0~1646 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f7314270cb381aa9edc97cd409e58beb5b8b8221;p=bacula%2Fbacula Keep Schedule run lists in order as suggested by + Bastian Friedrich. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6662 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/run_conf.c b/bacula/src/dird/run_conf.c index e7c2ad6c20..b339cdccb3 100644 --- a/bacula/src/dird/run_conf.c +++ b/bacula/src/dird/run_conf.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2007 Free Software Foundation Europe e.V. + Copyright (C) 2000-2008 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -186,7 +186,6 @@ void store_run(LEX *lc, RES_ITEM *item, int index, int pass) int token, state, state2 = 0, code = 0, code2 = 0; int options = lc->options; RUN **run = (RUN **)(item->value); - RUN *trun; char *p; RES *res; @@ -623,16 +622,24 @@ void store_run(LEX *lc, RES_ITEM *item, int index, int pass) } /* Allocate run record, copy new stuff into it, - * and link it into the list of run records + * and append it to the list of run records * in the schedule resource. */ if (pass == 2) { - trun = (RUN *)malloc(sizeof(RUN)); - memcpy(trun, &lrun, sizeof(RUN)); - if (*run) { - trun->next = *run; + RUN *tail; + + /* Create new run record */ + RUN *nrun = (RUN *)malloc(sizeof(RUN)); + memcpy(nrun, &lrun, sizeof(RUN)); + nrun ->next = NULL; + + if (!*run) { /* if empty list */ + *run = nrun; /* add new record */ + } else { + for (tail = *run; tail->next; tail=tail->next) + { } + tail->next = nrun; } - *run = trun; } lc->options = options; /* restore scanner options */ diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index d16744522f..53a207495a 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -22,6 +22,9 @@ Add long term statistic job table General: +22Mar08 +kes Keep Schedule run lists in order as suggested by + Bastian Friedrich. 21Mar08 kes Implement autostart scripts for Debian. ebl Implement upgrade catalog scripts.