From: Christian Grothoff Date: Fri, 9 Dec 2011 08:15:06 +0000 (+0000) Subject: -LRN: Fix for ARMed processes that have zero lsocks (such as hostlist) X-Git-Tag: initial-import-from-subversion-38251~15679 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2b62f9889b33905d9e08a8052bd93c9f51ec7e6f;p=oweals%2Fgnunet.git -LRN: Fix for ARMed processes that have zero lsocks (such as hostlist) --- 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);