summaryrefslogtreecommitdiff
path: root/netmon.c
diff options
context:
space:
mode:
Diffstat (limited to 'netmon.c')
-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);