From ac17d7f5a7aa5306c453ab065cc660fcf1ef4cb2 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 12 Mar 2021 13:26:50 +0100 Subject: [PATCH] Silence output from gzip in logrotate() - system may not have gzip (we're opportunistic) - system may not have the log file (yet) Signed-off-by: Joachim Wiberg --- src/logrotate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logrotate.c b/src/logrotate.c index eb3c3a3b..454447b8 100644 --- a/src/logrotate.c +++ b/src/logrotate.c @@ -80,7 +80,7 @@ int logrotate(char *file, int num, off_t sz) } if (cnt == 2 && fexist(nfile)) { - if (systemf("gzip %s", nfile)) + if (systemf("gzip %s 2>/dev/null", nfile)) continue; /* no gzip, probably */ (void)remove(nfile);