From 2b62f9889b33905d9e08a8052bd93c9f51ec7e6f Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 9 Dec 2011 08:15:06 +0000 Subject: [PATCH] -LRN: Fix for ARMed processes that have zero lsocks (such as hostlist) --- src/util/os_priority.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/os_priority.c b/src/util/os_priority.c index de3a5757e..6f5fa5007 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c @@ -1108,7 +1108,7 @@ GNUNET_OS_start_process_v (const SOCKTYPE *lsocks, GNUNET_free (path); return NULL; } - if (lsocks != NULL) + if (lsocks != NULL && lsocks[0] != INVALID_SOCKET) { lsocks_pipe = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO); @@ -1136,7 +1136,7 @@ GNUNET_OS_start_process_v (const SOCKTYPE *lsocks, GNUNET_asprintf (&our_env[0], "%s=", GNUNET_OS_CONTROL_PIPE); GNUNET_asprintf (&our_env[1], "%s", childpipename); GNUNET_free (childpipename); - if (lsocks == NULL) + if (lsocks == NULL || lsocks[0] == INVALID_SOCKET) our_env[2] = NULL; else { @@ -1178,7 +1178,7 @@ GNUNET_OS_start_process_v (const SOCKTYPE *lsocks, CloseHandle (proc.hThread); GNUNET_free (cmd); - if (lsocks == NULL) + if (lsocks == NULL || lsocks[0] == INVALID_SOCKET) return gnunet_proc; GNUNET_DISK_pipe_close_end (lsocks_pipe, GNUNET_DISK_PIPE_END_READ); -- 2.25.1