diff --git a/scheduler/job.c b/scheduler/job.c index e9d0944fb..eb093651d 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -1695,28 +1695,26 @@ cupsdLoadJob(cupsd_job_t *job) /* I - Job */ * Copy attribute data to the job object... */ - if (!ippFindAttribute(job->attrs, "time-at-creation", IPP_TAG_INTEGER)) + if ((job->state = ippFindAttribute(job->attrs, "job-state", + IPP_TAG_ENUM)) == NULL) { cupsdLogJob(job, CUPSD_LOG_ERROR, - "Missing or bad time-at-creation attribute in control file."); + "Missing or bad job-state attribute in control file."); goto error; } - if ((job->state = ippFindAttribute(job->attrs, "job-state", - IPP_TAG_ENUM)) == NULL) + if ((attr = ippFindAttribute(job->attrs, "time-at-creation", IPP_TAG_INTEGER)) == NULL) { cupsdLogJob(job, CUPSD_LOG_ERROR, - "Missing or bad job-state attribute in control file."); + "Missing or bad time-at-creation attribute in control file."); goto error; } + job->creation_time = attr->values[0].integer; job->state_value = (ipp_jstate_t)job->state->values[0].integer; job->file_time = 0; job->history_time = 0; - if ((attr = ippFindAttribute(job->attrs, "time-at-creation", IPP_TAG_INTEGER)) != NULL) - job->creation_time = attr->values[0].integer; - if (job->state_value >= IPP_JSTATE_CANCELED && (attr = ippFindAttribute(job->attrs, "time-at-completed", IPP_TAG_INTEGER)) != NULL) { job->completed_time = attr->values[0].integer;