Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
errno_exit.c
Go to the documentation of this file.
1
36#include <errno.h>
37#include <string.h>
38
39#include "utils/logging.h"
40
47void print_errno_and_exit(const char *where)
48{
49 volatile int last_errno;
50 last_errno = errno;
51 (void)last_errno;
52 LOG(FATAL, "%s: error (%d) %s\n", where, errno, strerror(errno));
53}
void print_errno_and_exit(const char *where)
Prints an error message about errno to std error and terminates the current program.
Definition errno_exit.c:47
#define LOG(level, message...)
Conditionally write a message to the logging output.
Definition logging.h:99
static const int FATAL
Loglevel that kills the current process.
Definition logging.h:51