Commit 0ae79f5e authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Communicate the panic string through heritage too.

parent 9584dc03
This diff is collapsed.
......@@ -50,8 +50,6 @@ extern pid_t mgt_pid;
/* mgt_shmem.c */
#define PAN_CLASS "Panic"
extern char *PAN_panicstr;
extern unsigned PAN_panicstr_len;
/* varnishd.c */
extern struct vsb *vident; // XXX: -> heritage ?
......
......@@ -64,6 +64,10 @@ struct heritage {
char *name;
char identity[1024];
char *panic_str;
ssize_t panic_str_len;
};
extern struct heritage heritage;
......
......@@ -427,10 +427,10 @@ mgt_handle_panicstr(pid_t r)
{
char time_str[30];
if (PAN_panicstr[0] == '\0')
if (heritage.panic_str[0] == '\0')
return;
REPORT(LOG_ERR, "Child (%jd) Panic message: %s",
(intmax_t)r, PAN_panicstr);
(intmax_t)r, heritage.panic_str);
if (child_panic)
VSB_delete(child_panic);
......@@ -438,7 +438,7 @@ mgt_handle_panicstr(pid_t r)
XXXAN(child_panic);
VTIM_format(VTIM_real(), time_str);
VSB_printf(child_panic, "Last panic at: %s\n", time_str);
VSB_cat(child_panic, PAN_panicstr);
VSB_cat(child_panic, heritage.panic_str);
AZ(VSB_finish(child_panic));
}
......
......@@ -215,7 +215,8 @@ mgt_SHM_Init(void)
AN(heritage.param);
*heritage.param = mgt_param;
PAN_panicstr_len = 64 * 1024;
PAN_panicstr = VSM_Alloc(PAN_panicstr_len, PAN_CLASS, "", "");
AN(PAN_panicstr);
heritage.panic_str_len = 64 * 1024;
heritage.panic_str =
VSM_Alloc(heritage.panic_str_len, PAN_CLASS, "", "");
AN(heritage.panic_str);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment