/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2012 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.
pthread_once_t key_once = PTHREAD_ONCE_INIT;
+static char Job_status[] = "Status Job=%s JobStatus=%d\n";
+
void lock_jobs()
{
return priority;
}
+/*
+ * Send Job status to Director
+ */
+bool JCR::sendJobStatus()
+{
+ JCR *jcr = this;
+ if (jcr->dir_bsock) {
+ return jcr->dir_bsock->fsend(Job_status, jcr->Job, jcr->JobStatus);
+ }
+ return true;
+}
-void set_jcr_job_status(JCR *jcr, int JobStatus)
+/*
+ * Set and send Job status to Director
+ */
+bool JCR::sendJobStatus(int newJobStatus)
{
- jcr->setJobStatus(JobStatus);
+ JCR *jcr = this;
+ if (!jcr->is_JobStatus(newJobStatus)) {
+ setJobStatus(newJobStatus);
+ if (jcr->dir_bsock) {
+ return jcr->dir_bsock->fsend(Job_status, jcr->Job, jcr->JobStatus);
+ }
+ }
+ return true;
}
+
void JCR::setJobStatus(int newJobStatus)
{
JCR *jcr = this;
}
if (oldJobStatus != jcr->JobStatus) {
- Dmsg2(800, "leave set_job_status old=%c new=%c\n", oldJobStatus, newJobStatus);
+ Dmsg2(800, "leave setJobStatus old=%c new=%c\n", oldJobStatus, newJobStatus);
// generate_plugin_event(jcr, bEventStatusChange, NULL);
}
}