From: Kern Sibbald Date: Fri, 6 Mar 2009 20:43:53 +0000 (+0000) Subject: Add JobErrors to returned SD values X-Git-Tag: Release-7.0.0~3340 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=983a4d83d67c40fe2280454df2c08924f56effcb;p=bacula%2Fbacula Add JobErrors to returned SD values git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8504 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/msgchan.c b/bacula/src/dird/msgchan.c index 5c2f1aa11c..f9cc3a2113 100644 --- a/bacula/src/dird/msgchan.c +++ b/bacula/src/dird/msgchan.c @@ -64,7 +64,7 @@ static char OK_device[] = "3000 OK use device device=%s\n"; /* Storage Daemon requests */ static char Job_start[] = "3010 Job %127s start\n"; static char Job_end[] = - "3099 Job %127s end JobStatus=%d JobFiles=%d JobBytes=%" lld "\n"; + "3099 Job %127s end JobStatus=%d JobFiles=%d JobBytes=%lld JobErrors=%u\n"; /* Forward referenced functions */ extern "C" void *msg_thread(void *arg); @@ -361,9 +361,8 @@ extern "C" void *msg_thread(void *arg) BSOCK *sd; int JobStatus; char Job[MAX_NAME_LENGTH]; - uint32_t JobFiles; + uint32_t JobFiles, JobErrors; uint64_t JobBytes; - int stat; pthread_detach(pthread_self()); set_jcr_in_tsd(jcr); @@ -379,14 +378,15 @@ extern "C" void *msg_thread(void *arg) if (sscanf(sd->msg, Job_start, Job) == 1) { continue; } - if ((stat=sscanf(sd->msg, Job_end, Job, &JobStatus, &JobFiles, - &JobBytes)) == 4) { + if (sscanf(sd->msg, Job_end, Job, &JobStatus, &JobFiles, + &JobBytes, &JobErrors) == 5) { jcr->SDJobStatus = JobStatus; /* termination status */ jcr->SDJobFiles = JobFiles; jcr->SDJobBytes = JobBytes; + jcr->SDErrors = JobErrors; break; } - Dmsg2(400, "end loop stat=%d use=%d\n", stat, jcr->use_count()); + Dmsg1(400, "end loop use=%d\n", jcr->use_count()); } if (is_bnet_error(sd)) { jcr->SDJobStatus = JS_ErrorTerminated; diff --git a/bacula/src/stored/fd_cmds.c b/bacula/src/stored/fd_cmds.c index 558df83f3a..2c6a5693ee 100644 --- a/bacula/src/stored/fd_cmds.c +++ b/bacula/src/stored/fd_cmds.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2008 Free Software Foundation Europe e.V. + Copyright (C) 2000-2009 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. @@ -102,7 +102,7 @@ static char ERROR_bootstrap[] = "3904 Error bootstrap\n"; /* Information sent to the Director */ static char Job_start[] = "3010 Job %s start\n"; char Job_end[] = - "3099 Job %s end JobStatus=%d JobFiles=%d JobBytes=%s\n"; + "3099 Job %s end JobStatus=%d JobFiles=%d JobBytes=%s JobErrors=%u\n"; /* * Run a File daemon Job -- File daemon already authorized @@ -131,7 +131,7 @@ void run_job(JCR *jcr) set_jcr_job_status(jcr, JS_Terminated); generate_daemon_event(jcr, "JobEnd"); dir->fsend(Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles, - edit_uint64(jcr->JobBytes, ec1)); + edit_uint64(jcr->JobBytes, ec1), jcr->JobErrors); dir->signal(BNET_EOD); /* send EOD to Director daemon */ return; } diff --git a/bacula/src/stored/job.c b/bacula/src/stored/job.c index c76beb8816..8b5add3f58 100644 --- a/bacula/src/stored/job.c +++ b/bacula/src/stored/job.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2008 Free Software Foundation Europe e.V. + Copyright (C) 2000-2009 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. diff --git a/bacula/src/stored/mac.c b/bacula/src/stored/mac.c index 08a719f357..b7768a811f 100644 --- a/bacula/src/stored/mac.c +++ b/bacula/src/stored/mac.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2006-2008 Free Software Foundation Europe e.V. + Copyright (C) 2006-2009 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. @@ -174,7 +174,7 @@ ok_out: } generate_daemon_event(jcr, "JobEnd"); dir->fsend(Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles, - edit_uint64(jcr->JobBytes, ec1)); + edit_uint64(jcr->JobBytes, ec1), jcr->JobErrors); Dmsg4(100, Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles, ec1); dir->signal(BNET_EOD); /* send EOD to Director daemon */ diff --git a/bacula/src/version.h b/bacula/src/version.h index 8a77f11df2..8f2a36bd0a 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -3,9 +3,9 @@ */ #undef VERSION -#define VERSION "2.5.40" -#define BDATE "18 February 2009" -#define LSMDATE "18Feb09" +#define VERSION "2.5.41" +#define BDATE "06 March 2009" +#define LSMDATE "06Mar09" #define PROG_COPYRIGHT "Copyright (C) %d-2009 Free Software Foundation Europe e.V.\n" #define BYEAR "2009" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 173eb38ab2..eb3fe34f04 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -30,7 +30,8 @@ kes Move src/win32/dll to src/win32/lib, which is much more logical. kes Fix the Win32 build. kes Fix broken casting in src/compat/print.cpp. kes Eliminate jcr Errors and always use jcr JobErrors. This should - ensure that SD and FD errors are correctly reported. + ensure that SD and FD errors are correctly reported. Also add + JobErrors to SD returned values. This should fix bug #1242. 28Feb09 mvw Implemented xattr support for Solaris 9 and above and extensible attributes for OpenSolaris.