From: Michael Tremer Date: Thu, 24 Oct 2024 12:45:56 +0000 (+0000) Subject: logging: Drop syslog-compatibility option X-Git-Tag: 0.9.30~915 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2725fbbd0a9618d272aaf0a592e738691caed058;p=pakfire.git logging: Drop syslog-compatibility option It is no longer possible to build Pakfire without systemd and so we don't need to carry around code that cannot be used. Signed-off-by: Michael Tremer --- diff --git a/configure.ac b/configure.ac index 40a2cdeb5..d172344d0 100644 --- a/configure.ac +++ b/configure.ac @@ -245,7 +245,6 @@ AC_CHECK_FUNCS([ \ getpid \ glob \ nftw \ - openlog \ personality \ prctl \ remove \ @@ -254,7 +253,6 @@ AC_CHECK_FUNCS([ \ snprintf \ strcmp \ strdup \ - syslog \ qsort \ uname \ unlink \ @@ -285,8 +283,7 @@ PKG_CHECK_MODULES([PCRE2], [libpcre2-8]) PKG_CHECK_MODULES([SECCOMP], [libseccomp]) PKG_CHECK_MODULES([SOLV], [libsolv >= 0.7.5]) PKG_CHECK_MODULES([SQLITE3], [sqlite3]) -PKG_CHECK_MODULES([SYSTEMD], [libsystemd], - [AC_DEFINE([HAVE_SYSTEMD], [1], [Use systemd])]) +PKG_CHECK_MODULES([SYSTEMD], [libsystemd]) PKG_CHECK_MODULES([UUID], [uuid]) PKG_CHECK_MODULES([ZSTD], [libzstd]) diff --git a/src/libpakfire/logging.c b/src/libpakfire/logging.c index 5236bce26..f6bb7856d 100644 --- a/src/libpakfire/logging.c +++ b/src/libpakfire/logging.c @@ -23,15 +23,11 @@ #include #include +#include + #include #include -#ifdef HAVE_SYSTEMD -#include -#else -#include -#endif - PAKFIRE_EXPORT void pakfire_log_stderr(void* data, int priority, const char* file, int line, const char* fn, const char* format, va_list args) { fprintf(stderr, "pakfire: "); @@ -43,8 +39,6 @@ PAKFIRE_EXPORT void pakfire_log_stderr(void* data, int priority, const char* fil vfprintf(stderr, format, args); } -#ifdef HAVE_SYSTEMD - PAKFIRE_EXPORT void pakfire_log_syslog(void* data, int priority, const char* file, int line, const char* fn, const char* format, va_list args) { char* buffer = NULL; @@ -80,13 +74,3 @@ PAKFIRE_EXPORT void pakfire_log_syslog(void* data, int priority, const char* fil if (buffer) free(buffer); } - -#else /* HAVE_SYSTEMD */ - -PAKFIRE_EXPORT void pakfire_log_syslog(void* data, int priority, const char* file, - int line, const char* fn, const char* format, va_list args) { - openlog("pakfire", LOG_PID, LOG_DAEMON); - vsyslog(priority | LOG_DAEMON, format, args); -} - -#endif /* HAVE_SYSTEMD */