summaryrefslogtreecommitdiffstats
path: root/avahi-daemon
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-06-11 16:43:47 +0000
committerLennart Poettering <lennart@poettering.net>2007-06-11 16:43:47 +0000
commit6189e8b44a5d38adb27524842005af3f347fd631 (patch)
tree8d4ab01787da5191ea4ce9e064e84544163775e9 /avahi-daemon
parent09ef82e2d020166c6291b4fed38adcc79fe7657e (diff)
use libdaemon's new daemon_close_all() function to close all fds when daemonizing. This requires libdaemon 0.11 (not yet released) to work, hence also bump the dep.
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1487 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-daemon')
-rw-r--r--avahi-daemon/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/avahi-daemon/main.c b/avahi-daemon/main.c
index 9f55473..884ad2e 100644
--- a/avahi-daemon/main.c
+++ b/avahi-daemon/main.c
@@ -1249,6 +1249,11 @@ int main(int argc, char *argv[]) {
if (config.use_syslog || config.daemonize)
daemon_log_use = DAEMON_LOG_SYSLOG;
+ if (daemon_close_all(-1) < 0) {
+ avahi_log_error("Failed to close remaining file descriptors: %s", strerror(errno));
+ goto finish;
+ }
+
if (make_runtime_dir() < 0)
goto finish;