Merge "[lib-fix] Fixed return value of kdbus_write_msg Change-Id: Ia3a45a6a79b4078929...
[platform/upstream/dbus.git] / bus / main.c
index e53e5f8..960a9c7 100644 (file)
@@ -61,10 +61,6 @@ signal_handler (int sig)
 {
   switch (sig)
     {
-#ifdef DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX
-    case SIGIO:
-      /* explicit fall-through */
-#endif /* DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX  */
 #ifdef SIGHUP
     case SIGHUP:
       {
@@ -142,9 +138,9 @@ usage (void)
       " [--introspect]"
       " [--address=ADDRESS]"
       " [--nopidfile]"
+      " [--nofork]"
 #ifdef DBUS_UNIX
       " [--fork]"
-      " [--nofork]"
       " [--systemd-activation]"
 #endif
       "\n");
@@ -416,12 +412,12 @@ main (int argc, char **argv)
         {
           introspect ();
         }
-#ifdef DBUS_UNIX
       else if (strcmp (arg, "--nofork") == 0)
         {
           flags &= ~BUS_CONTEXT_FLAG_FORK_ALWAYS;
           flags |= BUS_CONTEXT_FLAG_FORK_NEVER;
         }
+#ifdef DBUS_UNIX
       else if (strcmp (arg, "--fork") == 0)
         {
           flags &= ~BUS_CONTEXT_FLAG_FORK_NEVER;
@@ -649,11 +645,20 @@ main (int argc, char **argv)
 #ifdef SIGHUP
   _dbus_set_signal_handler (SIGHUP, signal_handler);
 #endif
-#ifdef DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX
-  _dbus_set_signal_handler (SIGIO, signal_handler);
-#endif /* DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX */
 #endif /* DBUS_UNIX */
 
+#ifdef ENABLE_KDBUS_TRANSPORT
+  if (bus_context_get_systemd_activation(context) == TRUE)
+    {
+      if (strncmp(bus_context_get_address(context), "kdbus:", strlen("kdbus:")) == 0 &&
+                  !strcmp(bus_context_get_type(context), "system") &&
+                  getuid() == 0)
+        {
+          kill (1, SIGUSR1);
+        }
+    }
+#endif
+
   _dbus_verbose ("We are on D-Bus...\n");
   _dbus_loop_run (bus_context_get_loop (context));