diff options
author | Alaa Eddine Elamri <alaeddine.elamri@bareos.com> | 2022-10-28 14:18:12 +0300 |
---|---|---|
committer | Andreas Rogge <andreas.rogge@bareos.com> | 2022-11-07 19:16:30 +0300 |
commit | d4c36b692473d72074abb014e9ef4d3054b403f0 (patch) | |
tree | 361af38ce3f12214c054eecfc1bc1b02230d4c91 | |
parent | 61b44e4b967180c2eec19bda3934cc185b79f4b8 (diff) |
replace volatile jobstatus with atomic
replace problematic accesses to JobStatus with getter
-rw-r--r-- | core/src/dird/admin.cc | 3 | ||||
-rw-r--r-- | core/src/dird/archive.cc | 3 | ||||
-rw-r--r-- | core/src/dird/backup.cc | 7 | ||||
-rw-r--r-- | core/src/dird/consolidate.cc | 3 | ||||
-rw-r--r-- | core/src/dird/dir_plugins.cc | 2 | ||||
-rw-r--r-- | core/src/dird/job.cc | 2 | ||||
-rw-r--r-- | core/src/dird/jobq.cc | 2 | ||||
-rw-r--r-- | core/src/dird/ndmp_dma_backup_common.cc | 3 | ||||
-rw-r--r-- | core/src/dird/ndmp_dma_restore_NDMP_BAREOS.cc | 4 | ||||
-rw-r--r-- | core/src/dird/ua_status.cc | 4 | ||||
-rw-r--r-- | core/src/dird/vbackup.cc | 3 | ||||
-rw-r--r-- | core/src/filed/dir_cmd.cc | 2 | ||||
-rw-r--r-- | core/src/filed/fd_plugins.cc | 2 | ||||
-rw-r--r-- | core/src/filed/status.cc | 3 | ||||
-rw-r--r-- | core/src/include/jcr.h | 2 | ||||
-rw-r--r-- | core/src/lib/jcr.cc | 14 | ||||
-rw-r--r-- | core/src/lib/runscript.cc | 10 | ||||
-rw-r--r-- | core/src/stored/append.cc | 2 | ||||
-rw-r--r-- | core/src/stored/bscan.cc | 2 | ||||
-rw-r--r-- | core/src/stored/fd_cmds.cc | 6 | ||||
-rw-r--r-- | core/src/stored/job.cc | 2 | ||||
-rw-r--r-- | core/src/stored/mac.cc | 4 | ||||
-rw-r--r-- | core/src/stored/ndmp_tape.cc | 2 | ||||
-rw-r--r-- | core/src/stored/sd_cmds.cc | 2 | ||||
-rw-r--r-- | core/src/stored/sd_plugins.cc | 2 | ||||
-rw-r--r-- | core/src/stored/status.cc | 3 |
26 files changed, 51 insertions, 43 deletions
diff --git a/core/src/dird/admin.cc b/core/src/dird/admin.cc index e3c91b2ef..8ce010cd9 100644 --- a/core/src/dird/admin.cc +++ b/core/src/dird/admin.cc @@ -98,7 +98,8 @@ void AdminCleanup(JobControlRecord* jcr, int TermCode) break; default: TermMsg = term_code; - sprintf(term_code, _("Inappropriate term code: %c\n"), jcr->JobStatus); + sprintf(term_code, _("Inappropriate term code: %c\n"), + jcr->getJobStatus()); break; } bstrftimes(schedt, sizeof(schedt), jcr->impl->jr.SchedTime); diff --git a/core/src/dird/archive.cc b/core/src/dird/archive.cc index 1d0a3dfca..a90751499 100644 --- a/core/src/dird/archive.cc +++ b/core/src/dird/archive.cc @@ -97,7 +97,8 @@ void ArchiveCleanup(JobControlRecord* jcr, int TermCode) break; default: TermMsg = term_code; - sprintf(term_code, _("Inappropriate term code: %c\n"), jcr->JobStatus); + sprintf(term_code, _("Inappropriate term code: %c\n"), + jcr->getJobStatus()); break; } diff --git a/core/src/dird/backup.cc b/core/src/dird/backup.cc index bd41e9616..d004f691a 100644 --- a/core/src/dird/backup.cc +++ b/core/src/dird/backup.cc @@ -683,12 +683,12 @@ int WaitForJobTermination(JobControlRecord* jcr, int timeout) * the SD despool. */ Dmsg5(100, "cancel=%d fd_ok=%d FDJS=%d JS=%d SDJS=%d\n", jcr->IsCanceled(), - fd_ok, jcr->impl->FDJobStatus.load(), jcr->JobStatus, + fd_ok, jcr->impl->FDJobStatus.load(), jcr->getJobStatus(), jcr->impl->SDJobStatus.load()); if (jcr->IsCanceled() || (!jcr->impl->res.job->RescheduleIncompleteJobs && !fd_ok)) { Dmsg4(100, "fd_ok=%d FDJS=%d JS=%d SDJS=%d\n", fd_ok, - jcr->impl->FDJobStatus.load(), jcr->JobStatus, + jcr->impl->FDJobStatus.load(), jcr->getJobStatus(), jcr->impl->SDJobStatus.load()); CancelStorageDaemonJob(jcr); } @@ -789,7 +789,8 @@ void NativeBackupCleanup(JobControlRecord* jcr, int TermCode) break; default: TermMsg = term_code; - sprintf(term_code, _("Inappropriate term code: %c\n"), jcr->JobStatus); + sprintf(term_code, _("Inappropriate term code: %c\n"), + jcr->getJobStatus()); break; } diff --git a/core/src/dird/consolidate.cc b/core/src/dird/consolidate.cc index 8206cb53b..9216c080d 100644 --- a/core/src/dird/consolidate.cc +++ b/core/src/dird/consolidate.cc @@ -361,7 +361,8 @@ void ConsolidateCleanup(JobControlRecord* jcr, int TermCode) break; default: TermMsg = term_code; - sprintf(term_code, _("Inappropriate term code: %c\n"), jcr->JobStatus); + sprintf(term_code, _("Inappropriate term code: %c\n"), + jcr->getJobStatus()); break; } bstrftimes(schedt, sizeof(schedt), jcr->impl->jr.SchedTime); diff --git a/core/src/dird/dir_plugins.cc b/core/src/dird/dir_plugins.cc index 6c6637796..6cd0bc640 100644 --- a/core/src/dird/dir_plugins.cc +++ b/core/src/dird/dir_plugins.cc @@ -644,7 +644,7 @@ static bRC bareosGetValue(PluginContext* ctx, brDirVariable var, void* value) case bDirVarJobStatus: *((int*)value) = jcr->JobStatus; Dmsg1(debuglevel, "dir-plugin: return bDirVarJobStatus=%c\n", - jcr->JobStatus); + jcr->getJobStatus()); break; case bDirVarPriority: *((int*)value) = jcr->JobPriority; diff --git a/core/src/dird/job.cc b/core/src/dird/job.cc index 30648b890..8882ccdff 100644 --- a/core/src/dird/job.cc +++ b/core/src/dird/job.cc @@ -649,7 +649,7 @@ static void* job_thread(void* arg) if (jcr->msg_queue && jcr->msg_queue->size() > 0) { DequeueMessages(jcr); } GeneratePluginEvent(jcr, bDirEventJobEnd); - Dmsg1(50, "======== End Job stat=%c ==========\n", jcr->JobStatus); + Dmsg1(50, "======== End Job stat=%c ==========\n", jcr->getJobStatus()); return NULL; } diff --git a/core/src/dird/jobq.cc b/core/src/dird/jobq.cc index d9a6883d6..128cc59bc 100644 --- a/core/src/dird/jobq.cc +++ b/core/src/dird/jobq.cc @@ -421,7 +421,7 @@ extern "C" void* jobq_server(void* arg) // Call user's routine here Dmsg3(2300, "Calling user engine for jobid=%d use=%d stat=%c\n", - jcr->JobId, jcr->UseCount(), jcr->JobStatus); + jcr->JobId, jcr->UseCount(), jcr->getJobStatus()); jq->engine(je->jcr); // Job finished detach from thread diff --git a/core/src/dird/ndmp_dma_backup_common.cc b/core/src/dird/ndmp_dma_backup_common.cc index 413343993..b9e569fe1 100644 --- a/core/src/dird/ndmp_dma_backup_common.cc +++ b/core/src/dird/ndmp_dma_backup_common.cc @@ -322,7 +322,8 @@ void NdmpBackupCleanup(JobControlRecord* jcr, int TermCode) break; default: TermMsg = term_code; - sprintf(term_code, _("Inappropriate term code: %c\n"), jcr->JobStatus); + sprintf(term_code, _("Inappropriate term code: %c\n"), + jcr->getJobStatus()); break; } diff --git a/core/src/dird/ndmp_dma_restore_NDMP_BAREOS.cc b/core/src/dird/ndmp_dma_restore_NDMP_BAREOS.cc index 9a2680cb5..955d07995 100644 --- a/core/src/dird/ndmp_dma_restore_NDMP_BAREOS.cc +++ b/core/src/dird/ndmp_dma_restore_NDMP_BAREOS.cc @@ -332,11 +332,11 @@ static inline int NdmpWaitForJobTermination(JobControlRecord* jcr) * so that we let the SD despool. */ Dmsg4(100, "cancel=%d FDJS=%d JS=%d SDJS=%d\n", jcr->IsCanceled(), - jcr->impl->FDJobStatus.load(), jcr->JobStatus, + jcr->impl->FDJobStatus.load(), jcr->getJobStatus(), jcr->impl->SDJobStatus.load()); if (jcr->IsCanceled() || (!jcr->impl->res.job->RescheduleIncompleteJobs)) { Dmsg3(100, "FDJS=%d JS=%d SDJS=%d\n", jcr->impl->FDJobStatus.load(), - jcr->JobStatus, jcr->impl->SDJobStatus.load()); + jcr->getJobStatus(), jcr->impl->SDJobStatus.load()); CancelStorageDaemonJob(jcr); } diff --git a/core/src/dird/ua_status.cc b/core/src/dird/ua_status.cc index f73af0b90..8494227ce 100644 --- a/core/src/dird/ua_status.cc +++ b/core/src/dird/ua_status.cc @@ -111,7 +111,7 @@ bool DotStatusCmd(UaContext* ua, const char* cmd) if (njcr->JobId != 0 && ua->AclAccessOk(Job_ACL, njcr->impl->res.job->resource_name_)) { ua->SendMsg(DotStatusJob, edit_int64(njcr->JobId, ed1), - njcr->JobStatus, njcr->JobErrors); + njcr->getJobStatus(), njcr->JobErrors); } } endeach_jcr(njcr); @@ -1068,7 +1068,7 @@ static void ListRunningJobs(UaContext* ua) default: emsg = (char*)GetPoolMemory(PM_FNAME); - Mmsg(emsg, _("is in unknown state %c"), jcr->JobStatus); + Mmsg(emsg, _("is in unknown state %c"), jcr->getJobStatus()); pool_mem = true; msg = emsg; break; diff --git a/core/src/dird/vbackup.cc b/core/src/dird/vbackup.cc index 5370a6616..29edcd2f3 100644 --- a/core/src/dird/vbackup.cc +++ b/core/src/dird/vbackup.cc @@ -485,7 +485,8 @@ void NativeVbackupCleanup(JobControlRecord* jcr, int TermCode, int JobLevel) break; default: TermMsg = term_code; - sprintf(term_code, _("Inappropriate term code: %c\n"), jcr->JobStatus); + sprintf(term_code, _("Inappropriate term code: %c\n"), + jcr->getJobStatus()); break; } diff --git a/core/src/filed/dir_cmd.cc b/core/src/filed/dir_cmd.cc index 773a0cfa5..a47ca928f 100644 --- a/core/src/filed/dir_cmd.cc +++ b/core/src/filed/dir_cmd.cc @@ -471,7 +471,7 @@ void* process_director_commands(JobControlRecord* jcr, BareosSocket* dir) if (jcr->JobId) { /* send EndJob if running a job */ char ed1[50], ed2[50]; // Send termination status back to Dir - dir->fsend(EndJob, jcr->JobStatus, jcr->JobFiles, + dir->fsend(EndJob, jcr->getJobStatus(), jcr->JobFiles, edit_uint64(jcr->ReadBytes, ed1), edit_uint64(jcr->JobBytes, ed2), jcr->JobErrors, jcr->impl->enable_vss, jcr->impl->crypto.pki_encrypt); diff --git a/core/src/filed/fd_plugins.cc b/core/src/filed/fd_plugins.cc index 07ffdefd3..43dc3e949 100644 --- a/core/src/filed/fd_plugins.cc +++ b/core/src/filed/fd_plugins.cc @@ -2056,7 +2056,7 @@ static bRC bareosGetValue(PluginContext* ctx, bVariable var, void* value) case bVarJobStatus: *((int*)value) = jcr->JobStatus; Dmsg1(debuglevel, "fd-plugin: return bVarJobStatus=%d\n", - jcr->JobStatus); + jcr->getJobStatus()); break; case bVarSinceTime: *((int*)value) = (int)jcr->impl->since_time; diff --git a/core/src/filed/status.cc b/core/src/filed/status.cc index 6355a2a7b..4d8f3d2b6 100644 --- a/core/src/filed/status.cc +++ b/core/src/filed/status.cc @@ -440,7 +440,8 @@ bool QstatusCmd(JobControlRecord* jcr) dir->fsend(OKqstatus, cmd); foreach_jcr (njcr) { if (njcr->JobId != 0) { - dir->fsend(DotStatusJob, njcr->JobId, njcr->JobStatus, njcr->JobErrors); + dir->fsend(DotStatusJob, njcr->JobId, njcr->getJobStatus(), + njcr->JobErrors); } } endeach_jcr(njcr); diff --git a/core/src/include/jcr.h b/core/src/include/jcr.h index 13270d394..931c4d38e 100644 --- a/core/src/include/jcr.h +++ b/core/src/include/jcr.h @@ -165,7 +165,7 @@ class JobControlRecord { uint64_t LastJobBytes{}; /**< Last sample number bytes */ uint64_t ReadBytes{}; /**< Bytes read -- before compression */ FileId_t FileId{}; /**< Last FileId used */ - volatile int32_t JobStatus{}; /**< ready, running, blocked, terminated */ + std::atomic<int32_t> JobStatus{}; /**< ready, running, blocked, terminated */ int32_t JobPriority{}; /**< Job priority */ time_t sched_time{}; /**< Job schedule time, i.e. when it should start */ time_t initial_sched_time{}; /**< Original sched time before any reschedules are done */ diff --git a/core/src/lib/jcr.cc b/core/src/lib/jcr.cc index c3de7a874..ae127a6b6 100644 --- a/core/src/lib/jcr.cc +++ b/core/src/lib/jcr.cc @@ -734,7 +734,7 @@ static int GetStatusPriority(int JobStatus) // Send Job status to Director bool JobControlRecord::sendJobStatus() { - if (dir_bsock) { return dir_bsock->fsend(Job_status, Job, JobStatus); } + if (dir_bsock) { return dir_bsock->fsend(Job_status, Job, getJobStatus()); } return true; } @@ -744,7 +744,7 @@ bool JobControlRecord::sendJobStatus(int newJobStatus) { if (!is_JobStatus(newJobStatus)) { setJobStatusWithPriorityCheck(newJobStatus); - if (dir_bsock) { return dir_bsock->fsend(Job_status, Job, JobStatus); } + if (dir_bsock) { return dir_bsock->fsend(Job_status, Job, getJobStatus()); } } return true; @@ -1042,11 +1042,11 @@ void DbgPrintJcr(FILE* fp) jcr; jcr = (JobControlRecord*)job_control_record_chain->next(jcr)) { fprintf(fp, "threadid=%s JobId=%d JobStatus=%c jcr=%p name=%s\n", edit_pthread(jcr->my_thread_id, ed1, sizeof(ed1)), (int)jcr->JobId, - jcr->JobStatus, jcr, jcr->Job); - fprintf(fp, - "threadid=%s killable=%d JobId=%d JobStatus=%c jcr=%p name=%s\n", - edit_pthread(jcr->my_thread_id, ed1, sizeof(ed1)), - jcr->IsKillable(), (int)jcr->JobId, jcr->JobStatus, jcr, jcr->Job); + jcr->getJobStatus(), jcr, jcr->Job); + fprintf( + fp, "threadid=%s killable=%d JobId=%d JobStatus=%c jcr=%p name=%s\n", + edit_pthread(jcr->my_thread_id, ed1, sizeof(ed1)), jcr->IsKillable(), + (int)jcr->JobId, jcr->getJobStatus(), jcr, jcr->Job); fprintf(fp, "\tUseCount=%i\n", jcr->UseCount()); fprintf(fp, "\tJobType=%c JobLevel=%c\n", jcr->getJobType(), jcr->getJobLevel()); diff --git a/core/src/lib/runscript.cc b/core/src/lib/runscript.cc index 94f1bfeac..8a17b7dd2 100644 --- a/core/src/lib/runscript.cc +++ b/core/src/lib/runscript.cc @@ -113,7 +113,7 @@ int RunScripts(JobControlRecord* jcr, int when; Dmsg2(200, "runscript: running all RunScript object (%s) JobStatus=%c\n", - label, jcr->JobStatus); + label, jcr->getJobStatus()); if (strstr(label, NT_("Before"))) { when = SCRIPT_Before; @@ -133,7 +133,7 @@ int RunScripts(JobControlRecord* jcr, "runscript: try to run (Target=%s, OnSuccess=%i, OnFailure=%i, " "CurrentJobStatus=%c, command=%s)\n", NSTDPRNT(script->target), script->on_success, script->on_failure, - jcr->JobStatus, NSTDPRNT(script->command)); + jcr->getJobStatus(), NSTDPRNT(script->command)); runit = false; if (!script->IsLocal()) { @@ -151,7 +151,7 @@ int RunScripts(JobControlRecord* jcr, && (JobCanceled(jcr) || jcr->JobStatus == JS_Differences))) { Dmsg4(200, "runscript: Run it because SCRIPT_Before (%s,%i,%i,%c)\n", script->command.c_str(), script->on_success, script->on_failure, - jcr->JobStatus); + jcr->getJobStatus()); runit = true; } } @@ -162,7 +162,7 @@ int RunScripts(JobControlRecord* jcr, Dmsg4(200, "runscript: Run it because SCRIPT_AfterVSS (%s,%i,%i,%c)\n", script->command.c_str(), script->on_success, script->on_failure, - jcr->JobStatus); + jcr->getJobStatus()); runit = true; } } @@ -173,7 +173,7 @@ int RunScripts(JobControlRecord* jcr, && (JobCanceled(jcr) || jcr->JobStatus == JS_Differences))) { Dmsg4(200, "runscript: Run it because SCRIPT_After (%s,%i,%i,%c)\n", script->command.c_str(), script->on_success, script->on_failure, - jcr->JobStatus); + jcr->getJobStatus()); runit = true; } } diff --git a/core/src/stored/append.cc b/core/src/stored/append.cc index 411890967..2fdedce74 100644 --- a/core/src/stored/append.cc +++ b/core/src/stored/append.cc @@ -415,7 +415,7 @@ bool DoAppendData(JobControlRecord* jcr, BareosSocket* bs, const char* what) bs->fsend("3999 Failed append\n"); } - Dmsg1(200, "Write EOS label JobStatus=%c\n", jcr->JobStatus); + Dmsg1(200, "Write EOS label JobStatus=%c\n", jcr->getJobStatus()); /* * Check if we can still write. This may not be the case diff --git a/core/src/stored/bscan.cc b/core/src/stored/bscan.cc index 22dd2cc5f..967354d8b 100644 --- a/core/src/stored/bscan.cc +++ b/core/src/stored/bscan.cc @@ -1310,7 +1310,7 @@ static bool UpdateJobRecord(BareosDb* db, break; default: TermMsg = term_code; - sprintf(term_code, _("Job Termination code: %d"), mjcr->JobStatus); + sprintf(term_code, _("Job Termination code: %d"), mjcr->getJobStatus()); break; } bstrftime(sdt, sizeof(sdt), mjcr->start_time); diff --git a/core/src/stored/fd_cmds.cc b/core/src/stored/fd_cmds.cc index a8ce421ba..917061b6d 100644 --- a/core/src/stored/fd_cmds.cc +++ b/core/src/stored/fd_cmds.cc @@ -181,7 +181,7 @@ void RunJob(JobControlRecord* jcr) GeneratePluginEvent(jcr, bSdEventJobEnd); - dir->fsend(Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles, + dir->fsend(Job_end, jcr->Job, jcr->getJobStatus(), jcr->JobFiles, edit_uint64(jcr->JobBytes, ec1), jcr->JobErrors); dir->signal(BNET_EOD); /* send EOD to Director daemon */ @@ -318,7 +318,7 @@ static bool AppendCloseSession(JobControlRecord* jcr) } // Send final statistics to File daemon - fd->fsend(OK_close, jcr->JobStatus); + fd->fsend(OK_close, jcr->getJobStatus()); Dmsg1(120, ">filed: %s", fd->msg); fd->signal(BNET_EOD); /* send EOD to File daemon */ @@ -414,7 +414,7 @@ static bool ReadCloseSession(JobControlRecord* jcr) } // Send final close msg to File daemon - fd->fsend(OK_close, jcr->JobStatus); + fd->fsend(OK_close, jcr->getJobStatus()); Dmsg1(160, ">filed: %s", fd->msg); fd->signal(BNET_EOD); /* send EOD to File daemon */ diff --git a/core/src/stored/job.cc b/core/src/stored/job.cc index f6a3d4318..623ca8aca 100644 --- a/core/src/stored/job.cc +++ b/core/src/stored/job.cc @@ -361,7 +361,7 @@ bool FinishCmd(JobControlRecord* jcr) GeneratePluginEvent(jcr, bSdEventJobEnd); - dir->fsend(Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles, + dir->fsend(Job_end, jcr->Job, jcr->getJobStatus(), jcr->JobFiles, edit_uint64(jcr->JobBytes, ec1), jcr->JobErrors); dir->signal(BNET_EOD); /* send EOD to Director daemon */ diff --git a/core/src/stored/mac.cc b/core/src/stored/mac.cc index 9a24c02a6..a4c6a29f3 100644 --- a/core/src/stored/mac.cc +++ b/core/src/stored/mac.cc @@ -711,9 +711,9 @@ bail_out: if (ok) { jcr->setJobStatusWithPriorityCheck(JS_Terminated); } GeneratePluginEvent(jcr, bSdEventJobEnd); - dir->fsend(Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles, + dir->fsend(Job_end, jcr->Job, jcr->getJobStatus(), jcr->JobFiles, edit_uint64(jcr->JobBytes, ec1), jcr->JobErrors); - Dmsg4(100, Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles, ec1); + Dmsg4(100, Job_end, jcr->Job, jcr->getJobStatus(), jcr->JobFiles, ec1); dir->signal(BNET_EOD); /* send EOD to Director daemon */ FreePlugins(jcr); /* release instantiated plugins */ diff --git a/core/src/stored/ndmp_tape.cc b/core/src/stored/ndmp_tape.cc index 78693ca83..ada800e5f 100644 --- a/core/src/stored/ndmp_tape.cc +++ b/core/src/stored/ndmp_tape.cc @@ -939,7 +939,7 @@ void EndOfNdmpBackup(JobControlRecord* jcr) /* Check if we can still write. This may not be the case * if we are at the end of the tape or we got a fatal I/O error. */ if (dcr->dev && dcr->dev->CanWrite()) { - Dmsg1(200, "Write EOS label JobStatus=%c\n", jcr->JobStatus); + Dmsg1(200, "Write EOS label JobStatus=%c\n", jcr->getJobStatus()); if (!WriteSessionLabel(dcr, EOS_LABEL)) { /* Print only if JobStatus JS_Terminated and not cancelled to avoid diff --git a/core/src/stored/sd_cmds.cc b/core/src/stored/sd_cmds.cc index b648a7f8f..9cfc6bb0c 100644 --- a/core/src/stored/sd_cmds.cc +++ b/core/src/stored/sd_cmds.cc @@ -263,7 +263,7 @@ bool DoListenRun(JobControlRecord* jcr) cleanup: GeneratePluginEvent(jcr, bSdEventJobEnd); - dir->fsend(Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles, + dir->fsend(Job_end, jcr->Job, jcr->getJobStatus(), jcr->JobFiles, edit_uint64(jcr->JobBytes, ec1), jcr->JobErrors); dir->signal(BNET_EOD); /* send EOD to Director daemon */ diff --git a/core/src/stored/sd_plugins.cc b/core/src/stored/sd_plugins.cc index 943ba9480..4b01a6a72 100644 --- a/core/src/stored/sd_plugins.cc +++ b/core/src/stored/sd_plugins.cc @@ -738,7 +738,7 @@ static bRC bareosGetValue(PluginContext* ctx, bsdrVariable var, void* value) case bsdVarJobStatus: *((int*)value) = jcr->JobStatus; Dmsg1(debuglevel, "sd-plugin: return bsdVarJobStatus=%c\n", - jcr->JobStatus); + jcr->getJobStatus()); break; case bsdVarVolumeName: if (jcr->impl->dcr) { diff --git a/core/src/stored/status.cc b/core/src/stored/status.cc index 27dd18f67..2451d52d4 100644 --- a/core/src/stored/status.cc +++ b/core/src/stored/status.cc @@ -985,7 +985,8 @@ bool DotstatusCmd(JobControlRecord* jcr) dir->fsend(OKdotstatus, cmd.c_str()); foreach_jcr (njcr) { if (njcr->JobId != 0) { - dir->fsend(DotStatusJob, njcr->JobId, njcr->JobStatus, njcr->JobErrors); + dir->fsend(DotStatusJob, njcr->JobId, njcr->getJobStatus(), + njcr->JobErrors); } } endeach_jcr(njcr); |