init_msg(JCR *jcr, MSGS *msg)
{
DEST *d, *dnew, *temp_chain = NULL;
+ int i;
if (jcr == NULL && msg == NULL) {
init_last_jobs_list();
*
*/
int fd;
- int i;
fd = open("/dev/null", O_RDONLY, 0644);
if (fd > 2) {
close(fd);
if (msg == NULL) {
daemon_msgs = (MSGS *)malloc(sizeof(MSGS));
memset(daemon_msgs, 0, sizeof(MSGS));
-#if !defined(HAVE_WIN32)
for (i=1; i<=M_MAX; i++) {
add_msg_dest(daemon_msgs, MD_STDOUT, i, NULL, NULL);
}
-#endif
Dmsg1(050, "Create daemon global message resource %p\n", daemon_msgs);
return;
}
}
if (type == M_ABORT || type == M_ERROR_TERM) {
-#if !defined(HAVE_WIN32)
fputs(dt, stdout);
fputs(msg, stdout); /* print this here to INSURE that it is printed */
fflush(stdout);
-#endif
}
/* Now figure out where to send the message */
if (trace) {
if (!trace_fd) {
char fn[200];
- bsnprintf(fn, sizeof(fn), "%s/bacula.trace", working_directory ? working_directory : ".");
+ bsnprintf(fn, sizeof(fn), "%s/%s.trace", working_directory ? working_directory : ".", my_name);
trace_fd = fopen(fn, "a+b");
}
if (trace_fd) {
if (level <= debug_level) {
if (!trace_fd) {
- bsnprintf(buf, sizeof(buf), "%s/bacula.trace", working_directory);
+ bsnprintf(buf, sizeof(buf), "%s/%s.trace", working_directory ? working_directory : ".", my_name);
trace_fd = fopen(buf, "a+b");
}
if (type == M_ABORT){
char *p = 0;
+ printf("Bacula forced SEG FAULT to obtain traceback.\n");
+ syslog(LOG_DAEMON|LOG_ERR, "Bacula forced SEG FAULT to obtain traceback.\n");
p[0] = 0; /* generate segmentation violation */
}
if (type == M_ERROR_TERM) {