diff --git a/log.c b/log.c index c12a99e..ccb425e 100644 --- a/log.c +++ b/log.c @@ -6,6 +6,20 @@ #include #include +#include + +static void __attribute__((constructor)) +init(void) +{ + openlog(NULL, /*LOG_PID*/0, LOG_USER); +} + +static void __attribute__((destructor)) +fini(void) +{ + closelog(); +} + static void _log(enum log_class log_class, const char *module, const char *file, int lineno, const char *fmt, int sys_errno, va_list va)