-better errno handling
authorChristian Grothoff <christian@grothoff.org>
Wed, 30 May 2012 12:56:40 +0000 (12:56 +0000)
committerChristian Grothoff <christian@grothoff.org>
Wed, 30 May 2012 12:56:40 +0000 (12:56 +0000)
src/util/os_priority.c

index fefb6a98ccb4aa9961d2e8916e792d4986d38d55..b8b1ba180aa66e8ba6cd6c4798a529054f8e01c0 100644 (file)
@@ -811,8 +811,11 @@ GNUNET_OS_start_process_vap (int pipe_control,
   ret = fork ();
   if (-1 == ret)
   {
+    int eno = errno;
+
     LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "fork");
     GNUNET_free_non_null (childpipename);
+    errno = eno;
     return NULL;
   }
   if (0 != ret)
@@ -1184,9 +1187,12 @@ GNUNET_OS_start_process_v (int pipe_control,
   ret = fork ();
   if (-1 == ret)
   {
+    int eno = errno;
+
     LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "fork");
     GNUNET_free_non_null (childpipename);
     GNUNET_array_grow (lscp, ls, 0);
+    errno = eno;
     return NULL;
   }
   if (0 != ret)