aboutsummaryrefslogtreecommitdiff
path: root/dhcp6s.c
diff options
context:
space:
mode:
Diffstat (limited to 'dhcp6s.c')
-rw-r--r--dhcp6s.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/dhcp6s.c b/dhcp6s.c
index 544afff..494e571 100644
--- a/dhcp6s.c
+++ b/dhcp6s.c
@@ -316,8 +316,13 @@ main(argc, argv)
}
if (foreground == 0) {
+ int fd;
+
if (daemon(0, 0) < 0)
err(1, "daemon");
+
+ for (fd = 3; fd < 1024; fd++)
+ close(fd);
}
/* dump current PID */