From 359888abf649ed3292210e3518aa669dac1480b9 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 1 Jan 2018 16:25:18 -0600 Subject: Cleanup logger.c, and move the facilitynames/prioritynames SYSLOG_NAMES stuff syslog.h does into lib.c and portability.h --- lib/lib.c | 1 + lib/portability.h | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/lib.c b/lib/lib.c index c4c4a149..8a818575 100644 --- a/lib/lib.c +++ b/lib/lib.c @@ -3,6 +3,7 @@ * Copyright 2006 Rob Landley */ +#define SYSLOG_NAMES #include "toys.h" void verror_msg(char *msg, int err, va_list va) diff --git a/lib/portability.h b/lib/portability.h index e62de139..50c935b5 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -246,3 +246,8 @@ pid_t xfork(void); static inline int get_sched_policy(int tid, void *policy) {return 0;} static inline char *get_sched_policy_name(int policy) {return "unknown";} #endif + +#ifndef SYSLOG_NAMES +typedef struct {char *c_name; int c_val;} CODE; +extern CODE prioritynames[], facilitynames[]; +#endif -- cgit v1.2.3