From db0ac01af53c114cb9e5845f489b342e14e214c6 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 17 Oct 2008 14:42:13 +0000 Subject: [PATCH] kes Minor cleanup of create_restore_volume_list() code. kes Fix typo in console Makefile.in git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7831 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/console/Makefile.in | 2 +- bacula/src/stored/parse_bsr.c | 13 ++++++++----- bacula/src/stored/protos.h | 2 -- bacula/src/version.h | 4 ++-- bacula/technotes-2.5 | 3 +++ 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/bacula/src/console/Makefile.in b/bacula/src/console/Makefile.in index 0069c10ec9..32109e43c4 100644 --- a/bacula/src/console/Makefile.in +++ b/bacula/src/console/Makefile.in @@ -83,7 +83,7 @@ devclean: realclean install: all @if test -f ${DESTDIR}${sbindir}/console; then \ echo " "; \ - echo "Warning!!! ${DESTDIR}${sbindir}console found."; \ + echo "Warning!!! ${DESTDIR}${sbindir}/console found."; \ echo " console has been renamed bconsole, so console"; \ echo " is no longer used, and you might want to delete it."; \ echo " "; \ diff --git a/bacula/src/stored/parse_bsr.c b/bacula/src/stored/parse_bsr.c index 12f43c54c6..fd3148a844 100644 --- a/bacula/src/stored/parse_bsr.c +++ b/bacula/src/stored/parse_bsr.c @@ -858,7 +858,7 @@ void free_bsr(BSR *bsr) /***************************************************************** * Routines for handling volumes */ -VOL_LIST *new_restore_volume() +static VOL_LIST *new_restore_volume() { VOL_LIST *vol; vol = (VOL_LIST *)malloc(sizeof(VOL_LIST)); @@ -873,30 +873,33 @@ VOL_LIST *new_restore_volume() * returns: 1 if volume added * 0 if volume already in list */ -int add_restore_volume(JCR *jcr, VOL_LIST *vol) +static bool add_restore_volume(JCR *jcr, VOL_LIST *vol) { VOL_LIST *next = jcr->VolList; if (!next) { /* list empty ? */ jcr->VolList = vol; /* yes, add volume */ } else { + /* Loop through all but last */ for ( ; next->next; next=next->next) { if (strcmp(vol->VolumeName, next->VolumeName) == 0) { + /* Save smallest start file */ if (vol->start_file < next->start_file) { next->start_file = vol->start_file; } - return 0; /* already in list */ + return false; /* already in list */ } } + /* Check last volume in list */ if (strcmp(vol->VolumeName, next->VolumeName) == 0) { if (vol->start_file < next->start_file) { next->start_file = vol->start_file; } - return 0; /* already in list */ + return false; /* already in list */ } next->next = vol; /* add volume */ } - return 1; + return true; } void free_restore_volume_list(JCR *jcr) diff --git a/bacula/src/stored/protos.h b/bacula/src/stored/protos.h index 05bb49c114..af8e667f89 100644 --- a/bacula/src/stored/protos.h +++ b/bacula/src/stored/protos.h @@ -191,8 +191,6 @@ bool mount_next_read_volume(DCR *dcr); BSR *parse_bsr(JCR *jcr, char *lf); void dump_bsr(BSR *bsr, bool recurse); void free_bsr(BSR *bsr); -VOL_LIST *new_restore_volume(); -int add_restore_volume(JCR *jcr, VOL_LIST *vol); void free_restore_volume_list(JCR *jcr); void create_restore_volume_list(JCR *jcr); diff --git a/bacula/src/version.h b/bacula/src/version.h index f68ac847b4..d164e24772 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.5.15" -#define BDATE "14 October 2008" -#define LSMDATE "14Oct08" +#define BDATE "17 October 2008" +#define LSMDATE "17Oct08" #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n" #define BYEAR "2008" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 7bcb0a2289..669f35b17c 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -17,6 +17,9 @@ dbdriver remove reader/writer in FOPTS???? General: +17Oct08 +kes Minor cleanup of create_restore_volume_list() code. +kes Fix typo in console Makefile.in 16Oct08 ebl Fix #1110 about RunScript that can't execute a script with Unicode caracters in the path. -- 2.39.5