textdomain("bacula-dir");
init_msg(NULL, NULL); /* initialize message handler */
daemon_start_time = time(NULL);
- memset(&last_job, 0, sizeof(last_job));
while ((ch = getopt(argc, argv, "c:d:fg:r:stu:v?")) != -1) {
switch (ch) {
delete_pid_file(director->pid_directory, "bacula-dir",
director->DIRport);
stop_watchdog();
- signal(SIGCHLD, SIG_IGN); /* don't worry about children now */
+// signal(SIGCHLD, SIG_IGN); /* don't worry about children now */
term_scheduler();
if (runjob) {
free(runjob);
cr.MinValue = counter->MinValue;
cr.MaxValue = counter->MaxValue;
cr.CurrentValue = counter->MinValue;
- bstrncpy(cr.WrapCounter, counter->WrapCounter->hdr.name, sizeof(cr.WrapCounter));
+ if (counter->WrapCounter) {
+ bstrncpy(cr.WrapCounter, counter->WrapCounter->hdr.name, sizeof(cr.WrapCounter));
+ } else {
+ cr.WrapCounter[0] = 0; /* empty string */
+ }
if (db_create_counter_record(NULL, db, &cr)) {
counter->CurrentValue = cr.CurrentValue;
counter->created = true;
-// Dmsg2(000, "Create counter %s val=%d\n", counter->hdr.name, counter->CurrentValue);
+ Dmsg2(100, "Create counter %s val=%d\n", counter->hdr.name, counter->CurrentValue);
}
- } else {
+ }
+ if (!counter->created) {
counter->CurrentValue = counter->MinValue; /* default value */
}
}