From 228149fc475948fe33085d7d157481cb923e4c11 Mon Sep 17 00:00:00 2001 From: Keuin Date: Thu, 30 Dec 2021 12:30:01 +0800 Subject: Fix one compiler warning. --- netmon.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'netmon.c') diff --git a/netmon.c b/netmon.c index f08825d..db9066d 100644 --- a/netmon.c +++ b/netmon.c @@ -43,7 +43,11 @@ void daemonize() { log_error(logger, "setsid() failed."); exit(1); } - chdir("/"); + if (chdir("/")) { + perror("chdir()"); + log_error(logger, "chdir() failed,"); + exit(1); + } close(STDIN_FILENO); close(STDOUT_FILENO); close(STDERR_FILENO); -- cgit v1.2.3