From 392384c9f16632b2e9e1a47b65ddd08238785646 Mon Sep 17 00:00:00 2001 From: Moe-hacker Date: Sat, 30 Nov 2024 01:57:18 +0000 Subject: [PATCH] Output to /dev/null if no logfile --- src/ruri.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ruri.c b/src/ruri.c index 7e1913c..56edcbe 100644 --- a/src/ruri.c +++ b/src/ruri.c @@ -611,6 +611,11 @@ static void parse_args(int argc, char **_Nonnull argv, struct RURI_CONTAINER *_N dup2(logfd, STDOUT_FILENO); dup2(logfd, STDERR_FILENO); close(logfd); + } else { + int nullfd = open("/dev/null", O_RDWR); + dup2(nullfd, STDOUT_FILENO); + dup2(nullfd, STDERR_FILENO); + close(nullfd); } } // Build the caplist to drop.