return jcr;
}
}
+
/* Wait until we have something in the
* next hour or so.
*/
void term_scheduler()
{
if (jobs_to_run) {
- job_item *je;
- /* Release all queued job entries to be run */
- foreach_dlist(je, jobs_to_run) {
- free(je);
- }
delete jobs_to_run;
}
}
woy = tm_woy(now); /* get week of year */
Dmsg7(dbglvl, "now = %x: h=%d m=%d md=%d wd=%d wom=%d woy=%d\n",
- now, hour, month, mday, wday, wom, woy);
+ now, hour, month, mday, wday, wom, woy);
/*
* Compute values for next hour from now.
nh_woy = tm_woy(now); /* get week of year */
Dmsg7(dbglvl, "nh = %x: h=%d m=%d md=%d wd=%d wom=%d woy=%d\n",
- next_hour, nh_hour, nh_month, nh_mday, nh_wday, nh_wom, nh_woy);
+ next_hour, nh_hour, nh_month, nh_mday, nh_wday, nh_wom, nh_woy);
/* Loop through all jobs */
LockRes();
Dmsg3(dbglvl, "run@%p: run_now=%d run_nh=%d\n", run, run_now, run_nh);
- if (run_now || run_nh) {
- /* find time (time_t) job is to be run */
- (void)localtime_r(&now, &tm); /* reset tm structure */
- tm.tm_min = run->minute; /* set run minute */
- tm.tm_sec = 0; /* zero secs */
- runtime = mktime(&tm);
- if (run_now) {
- add_job(job, run, now, runtime);
- }
- /* If job is to be run in the next hour schedule it */
- if (run_nh) {
- add_job(job, run, now, runtime + 3600);
- }
- }
+ if (run_now || run_nh) {
+ /* find time (time_t) job is to be run */
+ (void)localtime_r(&now, &tm); /* reset tm structure */
+ tm.tm_min = run->minute; /* set run minute */
+ tm.tm_sec = 0; /* zero secs */
+ runtime = mktime(&tm);
+ if (run_now) {
+ add_job(job, run, now, runtime);
+ }
+ /* If job is to be run in the next hour schedule it */
+ if (run_nh) {
+ add_job(job, run, now, runtime + 3600);
+ }
+ }
}
}
UnlockRes();
recycle = false;
if (unload_device) {
Dmsg0(150, "mount_next_volume release=1\n");
- release_volume(dcr);
unload_autochanger(dcr, -1);
+ release_volume();
unload_device = false;
ask = true; /* ask operator to mount tape */
}
* Either because we are going to hang a new volume, or because
* of explicit user request, we release the current volume.
*/
-void release_volume(DCR *dcr)
+void DCR::release_volume()
{
- JCR *jcr = dcr->jcr;
- DEVICE *dev = dcr->dev;
- if (dcr->WroteVol) {
+ if (WroteVol) {
Jmsg0(jcr, M_ERROR, 0, _("Hey!!!!! WroteVol non-zero !!!!!\n"));
Dmsg0(190, "Hey!!!!! WroteVol non-zero !!!!!\n");
}
dev->block_num = dev->file = 0;
dev->EndBlock = dev->EndFile = 0;
memset(&dev->VolCatInfo, 0, sizeof(dev->VolCatInfo));
-// memset(&dcr->VolCatInfo, 0, sizeof(dcr->VolCatInfo));
+ memset(&VolCatInfo, 0, sizeof(VolCatInfo));
dev->clear_volhdr();
/* Force re-read of label */
dev->clear_labeled();
dev->clear_read();
dev->clear_append();
dev->label_type = B_BACULA_LABEL;
-// dcr->VolumeName[0] = 0;
+ VolumeName[0] = 0;
if (dev->is_open() && (!dev->is_tape() || !dev->has_cap(CAP_ALWAYSOPEN))) {
dev->close();