daemon: first take name on the bus, then return in starter process
authorLennart Poettering <lennart@poettering.net>
Thu, 14 Jan 2010 01:33:49 +0000 (02:33 +0100)
committerLennart Poettering <lennart@poettering.net>
Sun, 21 Feb 2010 16:53:24 +0000 (17:53 +0100)
http://pulseaudio.org/ticket/748

src/daemon/main.c

index 5ccda77..9bea2ae 100644 (file)
@@ -1027,15 +1027,6 @@ int main(int argc, char *argv[]) {
      * from now on, if requested */
     c->disallow_module_loading = !!conf->disallow_module_loading;
 
-#ifdef HAVE_FORK
-    if (daemon_pipe[1] >= 0) {
-        int ok = 0;
-        pa_loop_write(daemon_pipe[1], &ok, sizeof(ok), NULL);
-        pa_close(daemon_pipe[1]);
-        daemon_pipe[1] = -1;
-    }
-#endif
-
 #ifdef HAVE_DBUS
     if (!conf->system_instance) {
         if (!(server_lookup = pa_dbusobj_server_lookup_new(c)))
@@ -1048,6 +1039,15 @@ int main(int argc, char *argv[]) {
         goto finish;
 #endif
 
+#ifdef HAVE_FORK
+    if (daemon_pipe[1] >= 0) {
+        int ok = 0;
+        pa_loop_write(daemon_pipe[1], &ok, sizeof(ok), NULL);
+        pa_close(daemon_pipe[1]);
+        daemon_pipe[1] = -1;
+    }
+#endif
+
     pa_log_info(_("Daemon startup complete."));
 
     retval = 0;