void my_thread_send_signal(int sig); /* in lib/jcr.c */
void set_killable(bool killable); /* in lib/jcr.c */
bool is_killable() const { return my_thread_killable; };
+ job_code_callback_t job_code_callback; /* Callback sending messages defined by the user */
/* Global part of JCR common to all daemons */
dlink link; /* JCR chain link */
bool dbg_timestamp = false; /* print timestamp in debug output */
bool dbg_thread = false; /* add thread_id to details */
bool prt_kaboom = false; /* Print kaboom output */
-job_code_callback_t message_job_code_callback = NULL; /* Job code callback. Only used by director. */
/* Forward referenced functions */
set_jcr_in_tsd(INVALID_JCR);
}
- message_job_code_callback = job_code_callback;
+ if (jcr) {
+ jcr->job_code_callback = job_code_callback;
+ }
#if !defined(HAVE_WIN32)
/*
BPIPE *bpipe;
if (d->mail_cmd) {
- cmd = edit_job_codes(jcr, cmd, d->mail_cmd, d->where, message_job_code_callback);
+ cmd = edit_job_codes(jcr, cmd, d->mail_cmd, d->where, jcr ? jcr->job_code_callback : NULL);
} else {
Mmsg(cmd, "/usr/lib/sendmail -F Bacula %s", d->where);
}