From 353684f5dda63559ed938e36dfc0252e26590daa Mon Sep 17 00:00:00 2001 From: Justin Stephenson Date: Mon, 2 Nov 2020 15:42:55 -0500 Subject: [PATCH] Skip utmp removal with piped IO on stdin --- lib/tlog/tap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tlog/tap.c b/lib/tlog/tap.c index 81389be5..68de3a43 100644 --- a/lib/tlog/tap.c +++ b/lib/tlog/tap.c @@ -337,7 +337,7 @@ tlog_tap_teardown(struct tlog_errs **perrs, tlog_source_destroy(tap->source); tap->source = NULL; - if (tap->in_fd >= 0) { + if ((tap->in_fd >= 0) && (isatty(tap->in_fd))) { #ifdef HAVE_UTEMPTER if (utempter_remove_record(tap->in_fd) == 0) { grc = TLOG_GRC_ERRNO;