mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-31 07:11:09 -04:00
xmalloc: log error to syslog() in fatal_error() function
This commit is contained in:
parent
f1fce96a1d
commit
014019e98d
2 changed files with 3 additions and 1 deletions
|
|
@ -2,11 +2,14 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <syslog.h>
|
||||||
#include "xmalloc.h"
|
#include "xmalloc.h"
|
||||||
|
|
||||||
static NORETURN COLD void
|
static NORETURN COLD void
|
||||||
fatal_error(const char *msg, int err)
|
fatal_error(const char *msg, int err)
|
||||||
{
|
{
|
||||||
|
syslog(LOG_ERR, "%s: %s", msg, strerror(err));
|
||||||
errno = err;
|
errno = err;
|
||||||
perror(msg);
|
perror(msg);
|
||||||
abort();
|
abort();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
|
|
||||||
void *xmalloc(size_t size) XMALLOC;
|
void *xmalloc(size_t size) XMALLOC;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue