]> git.meshlink.io Git - catta/commitdiff
use libdaemon's new daemon_close_all() function to close all fds when daemonizing...
authorLennart Poettering <lennart@poettering.net>
Mon, 11 Jun 2007 16:43:47 +0000 (16:43 +0000)
committerLennart Poettering <lennart@poettering.net>
Mon, 11 Jun 2007 16:43:47 +0000 (16:43 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1487 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-daemon/main.c
configure.ac

index 9f5547382daa5dcf010964939575735edc18f28d..884ad2ed3fcfb36b1c55161152a96a6a4df9edf1 100644 (file)
@@ -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;
 
index 7632b37c448f348cfb3cb4f60e08f62b84e2ca7e..1b3a6f6f807b96a9565d86d0eb8767600a9916a2 100644 (file)
@@ -659,7 +659,7 @@ AC_ARG_ENABLE(libdaemon,
         [HAVE_LIBDAEMON=yes]) 
 
 if test "x$HAVE_LIBDAEMON" = "xyes" ; then
-    PKG_CHECK_MODULES(LIBDAEMON, [ libdaemon >= 0.5 ])
+    PKG_CHECK_MODULES(LIBDAEMON, [ libdaemon >= 0.11 ])
     AC_SUBST(LIBDAEMON_CFLAGS)
     AC_SUBST(LIBDAEMON_LIBS)
 fi