Merge branch 'dbus-1.4' of ssh://git.freedesktop.org/git/dbus/dbus into dbus-1.4
[platform/upstream/dbus.git] / test / spawn-test.c
index fda0309..f1a5505 100644 (file)
@@ -1,10 +1,18 @@
+#include <config.h>
 #include <dbus/dbus.h>
 
 #define DBUS_COMPILATION /* cheat and use dbus-sysdeps */
 #include <dbus/dbus-sysdeps.h>
+#include <dbus/dbus-spawn.h>
 #undef DBUS_COMPILATION
 #include <stdio.h>
 
+static void
+setup_func (void *data)
+{
+  printf ("entering setup func.\n");
+}
+
 int
 main (int argc, char **argv)
 {
@@ -24,11 +32,13 @@ main (int argc, char **argv)
     argv_copy [i] = argv[i + 1];
   argv_copy[argc - 1] = NULL;
   
-  if (!_dbus_spawn_async (argv_copy, &error))
+  if (!_dbus_spawn_async_with_babysitter (NULL, argv_copy, NULL, setup_func, NULL, &error))
     {
       fprintf (stderr, "Could not launch application: \"%s\"\n",
               error.message);
     }
-  
+
+  dbus_free(argv_copy);
   return 0;
 }