From a8060d0ad1950b66c2a451fd834a820762ea8361 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Thu, 24 Oct 2019 10:49:57 +0200 Subject: [PATCH] Fix tsyslogd, which reads from stdin, exit on EOF Signed-off-by: Joachim Nilsson --- src/syslogd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/syslogd.c b/src/syslogd.c index 5b58311..2a2718c 100644 --- a/src/syslogd.c +++ b/src/syslogd.c @@ -1227,11 +1227,12 @@ int main(int argc, char *argv[]) if (i > 0) { printchopped(LocalHostName, line, i + 1, fileno(stdin)); } else if (i < 0) { - if (errno != EINTR) { + if (errno != EINTR) logerror("stdin"); - } - } - FD_CLR(fileno(stdin), &readfds); + } else { + logit("EOF\n"); + exit(0); + } } #endif