Why g_spawn_async return a null pid under Windows?



Hi,

I have a small program that spawn process with g_spawn_async, but the returned GPid is NULL. I works under Windows (I don't have this problem under Linux).

-----
#include <glib.h>

int main (void)
{
 GPid pid;
 GError *error = NULL;
 gchar *argv[] = {"test.exe", NULL};

 if (g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &pid,
                    &error))
 {
   g_print ("%p\n", pid);
 }
 else
 {
   g_print (error->message);
   g_error_free (error), error = NULL;
 }
 return 0;
}
-----

The process is launched with the _wspawnvp function and the GPid is an intptr_t, isn't it?

Thank's in advance.

Best regards.

--
Nicolas Joseph

Responsable de la rubrique GTK+ de developpez.com /
In charge of the GTK+ section on developpez.com

http://nicolasj.developpez.com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]