summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeuin <[email protected]>2021-12-30 12:30:01 +0800
committerKeuin <[email protected]>2021-12-30 12:30:01 +0800
commit228149fc475948fe33085d7d157481cb923e4c11 (patch)
tree29a7979ae541f772e66a5e2f7045ccb5a3c8e124
parentb3fd60e6407b3af029672218b0bff7bb30e7a9d9 (diff)
Fix one compiler warning.v1.1.0
-rw-r--r--netmon.c6
1 files changed, 5 insertions, 1 deletions
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);