From: Juergen Gross Date: Tue, 15 Dec 2020 16:35:39 +0000 (+0100) Subject: tools/xenstore: switch barf[_perror]() to use syslog() X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~1265 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cbc86340ac75c8ff50e51a16c8fdbdf3d2a7c55d;p=xen.git tools/xenstore: switch barf[_perror]() to use syslog() When xenstored crashes due to an unrecoverable condition it is calling either barf() or barf_perror() to issue a message and then exit(). Make sure the message is visible somewhere by using syslog() additionally to xprintf(), as the latter will be visible only with tracing active. Signed-off-by: Juergen Gross Reviewed-by: Paul Durrant Reviewed-by: Julien Grall --- diff --git a/tools/xenstore/utils.c b/tools/xenstore/utils.c index a1ac12584a..633ce3b4fc 100644 --- a/tools/xenstore/utils.c +++ b/tools/xenstore/utils.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -35,6 +36,7 @@ void barf(const char *fmt, ...) va_end(arglist); if (bytes >= 0) { + syslog(LOG_CRIT, "%s\n", str); xprintf("%s\n", str); free(str); } @@ -54,6 +56,7 @@ void barf_perror(const char *fmt, ...) va_end(arglist); if (bytes >= 0) { + syslog(LOG_CRIT, "%s: %s\n", str, strerror(err)); xprintf("%s: %s\n", str, strerror(err)); free(str); }