Merge "Optional autogen.sh flag --enable-kdbus-transport added allowing to compile...
[platform/upstream/dbus.git] / tools / dbus-launch-win.c
index 6e289a6..d899010 100644 (file)
@@ -130,9 +130,10 @@ main (int argc, char **argv)
      fprintf (stderr, "%ls %ls\n", dbusDaemonPath, command);
 #else
    command[0] = L'\0';
-   /* Windows CE has a different interpretation of cmdline: Start with argv[1].  */
-   wcscpy_s (command, sizeof (command), dbusDaemonPath);
-   wcscat_s (command, sizeof (command), L" --session");
+   /* Windows cmdline starts with path, which can contain spaces.  */
+   wcscpy_s (command, sizeof (command), L"\"");
+   wcscat_s (command, sizeof (command), dbusDaemonPath);
+   wcscat_s (command, sizeof (command), L"\" --session");
    if (verbose)
      fprintf (stderr, "%ls\n", command);
 #endif
@@ -150,22 +151,16 @@ main (int argc, char **argv)
   flags |= NORMAL_PRIORITY_CLASS;
   if (!verbose)
     flags |= DETACHED_PROCESS;
-  fprintf (stderr, "0b: %i\n", flags);
 #endif
 
-  fprintf (stderr, "1 %ls\n", dbusDaemonPath);
-  fprintf (stderr, "2 %ls\n", command);
-  fprintf (stderr, "3 %i\n", inherit);
-  fprintf (stderr, "4 %i\n", flags);
-
   result = CreateProcessW (dbusDaemonPath, command, 0, 0,
                            inherit, flags, 0, 0, &si, &pi);
 
   if (result == 0) 
     {
       if (verbose)
-        fprintf (stderr, "Could not start " DBUS_DAEMON_NAME ". error=%d\n",
-                 GetLastError ());
+        fprintf (stderr, "Could not start " DBUS_DAEMON_NAME ". error=%u\n",
+                 (unsigned)GetLastError ());
       return 4;
     }