From 100449869727ea277e72430fb79e02dae5b42704 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Tue, 22 Oct 2019 16:41:52 +0200 Subject: [PATCH] Add support for building tsyslogd and syslog_tst again Signed-off-by: Joachim Nilsson --- src/.gitignore | 2 ++ src/Makefile.am | 7 +++++++ src/syslog_tst.c | 2 +- src/syslogd.c | 2 ++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/.gitignore b/src/.gitignore index cab5efc..dd37664 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -2,3 +2,5 @@ klogd logger syslogd +syslog_tst +tsyslogd diff --git a/src/Makefile.am b/src/Makefile.am index b980303..1a3b392 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,6 +18,7 @@ bin_PROGRAMS = logger sbin_PROGRAMS = syslogd klogd +noinst_PROGRAMS = tsyslogd syslog_tst AM_CFLAGS = -W -Wall -Wextra AM_CFLAGS += -Wno-unused-result -Wno-unused-parameter @@ -34,3 +35,9 @@ klogd_CPPFLAGS = -DSYSV -DFSSTND -DALLOW_KERNEL_LOGGING \ logger_SOURCES = logger.c logger_CPPFLAGS = -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE + +tsyslogd_SOURCES = syslogd.c pidfile.c pidfile.h +tsyslogd_CPPFLAGS = -DSYSV -DFSSTND -DSYSLOG_INET -DINET6 -DNO_SCCS -DSYSLOG_UNIXAF \ + -D_BSD_SOURCE -D_SVID_SOURCE -D_DEFAULT_SOURCE -DTESTING + +syslog_tst_SOURCES = syslog_tst.c diff --git a/src/syslog_tst.c b/src/syslog_tst.c index 41cc59c..86e209d 100644 --- a/src/syslog_tst.c +++ b/src/syslog_tst.c @@ -23,7 +23,7 @@ int main(int argc, char *argv[]) { - char *nl, + char *nl; char bufr[512]; int logged = 0; diff --git a/src/syslogd.c b/src/syslogd.c index 3e30b58..eedf320 100644 --- a/src/syslogd.c +++ b/src/syslogd.c @@ -1187,6 +1187,7 @@ int main(int argc, char *argv[]) restart = 0; logit("\nReceived SIGHUP, reloading syslogd.\n"); init(); +#ifndef TESTING if (check_pid(PidFile)) { if (touch_pid(PidFile)) logerror("Not possible to touch pidfile"); @@ -1194,6 +1195,7 @@ int main(int argc, char *argv[]) if (!write_pid(PidFile)) logerror("Failed to write pidfile"); } +#endif continue; } if (nfds == 0) {