diff options
| author | Craig Barnes <craigbarnes@protonmail.com> | 2020-08-05 19:11:51 +0000 |
|---|---|---|
| committer | Craig Barnes <craigbarnes@protonmail.com> | 2020-08-05 19:11:51 +0000 |
| commit | 014019e98da7fa0f7476bea5b6f3c84dafe7558a (patch) | |
| tree | 5ba24f69d383378a9a3fe86c8d83cbead89f19c1 /xmalloc.c | |
| parent | config: handle allocation failure explicitly (diff) | |
xmalloc: log error to syslog() in fatal_error() function
Diffstat (limited to 'xmalloc.c')
| -rw-r--r-- | xmalloc.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -2,11 +2,14 @@ #include <stdarg.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> +#include <syslog.h> #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(); |
