From 014019e98da7fa0f7476bea5b6f3c84dafe7558a Mon Sep 17 00:00:00 2001 From: Craig Barnes Date: Wed, 5 Aug 2020 20:11:51 +0100 Subject: [PATCH] xmalloc: log error to syslog() in fatal_error() function --- xmalloc.c | 3 +++ xmalloc.h | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/xmalloc.c b/xmalloc.c index aecb5787..7322953a 100644 --- a/xmalloc.c +++ b/xmalloc.c @@ -2,11 +2,14 @@ #include #include #include +#include +#include #include "xmalloc.h" static NORETURN COLD void fatal_error(const char *msg, int err) { + syslog(LOG_ERR, "%s: %s", msg, strerror(err)); errno = err; perror(msg); abort(); diff --git a/xmalloc.h b/xmalloc.h index d4e48f79..90d63031 100644 --- a/xmalloc.h +++ b/xmalloc.h @@ -1,7 +1,6 @@ #pragma once #include -#include #include "macros.h" void *xmalloc(size_t size) XMALLOC;