Skip to content

Commit

Permalink
Fix problem with Job Lookup.
Browse files Browse the repository at this point in the history
Only perform lookup of previous Job when we found a JobName.
  • Loading branch information
Marco van Wieringen committed Nov 10, 2014
1 parent 4b4d478 commit 1bf3040
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/dird/job.c
Expand Up @@ -932,7 +932,8 @@ bool get_level_since_time(JCR *jcr)
if (!jcr->stime) {
jcr->stime = get_pool_memory(PM_MESSAGE);
}
jcr->PrevJob[0] = jcr->stime[0] = 0;
jcr->PrevJob[0] = 0;
jcr->stime[0] = 0;

/*
* Lookup the last FULL backup job to get the time/date for a
Expand Down Expand Up @@ -1043,9 +1044,11 @@ bool get_level_since_time(JCR *jcr)
/*
* Lookup the Job record of the previous Job and store it in jcr->previous_jr.
*/
bstrncpy(jcr->previous_jr.Job, jcr->PrevJob, sizeof(jcr->previous_jr.Job));
if (!db_get_job_record(jcr, jcr->db, &jcr->previous_jr)) {
Jmsg(jcr, M_FATAL, 0, _("Could not get job record for previous Job. ERR=%s"), db_strerror(jcr->db));
if (jcr->PrevJob[0]) {
bstrncpy(jcr->previous_jr.Job, jcr->PrevJob, sizeof(jcr->previous_jr.Job));
if (!db_get_job_record(jcr, jcr->db, &jcr->previous_jr)) {
Jmsg(jcr, M_FATAL, 0, _("Could not get job record for previous Job. ERR=%s"), db_strerror(jcr->db));
}
}

break;
Expand Down

0 comments on commit 1bf3040

Please sign in to comment.