[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r27245 - gnunet/src/util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r27245 - gnunet/src/util |
Date: |
Wed, 22 May 2013 12:25:34 +0200 |
Author: grothoff
Date: 2013-05-22 12:25:34 +0200 (Wed, 22 May 2013)
New Revision: 27245
Modified:
gnunet/src/util/disk.c
gnunet/src/util/os_priority.c
Log:
-need to unset control pipe on OSX, check for bad FD in environment variable
Modified: gnunet/src/util/disk.c
===================================================================
--- gnunet/src/util/disk.c 2013-05-22 10:15:45 UTC (rev 27244)
+++ gnunet/src/util/disk.c 2013-05-22 10:25:34 UTC (rev 27245)
@@ -1930,13 +1930,17 @@
* Get a handle from a native integer FD.
*
* @param fno native integer file descriptor
- * @return file handle corresponding to the descriptor
+ * @return file handle corresponding to the descriptor, NULL on error
*/
struct GNUNET_DISK_FileHandle *
GNUNET_DISK_get_handle_from_int_fd (int fno)
{
struct GNUNET_DISK_FileHandle *fh;
+ if ( (((off_t) -1) == lseek (fno, 0, SEEK_CUR)) &&
+ (EBADF == errno) )
+ return NULL; /* invalid FD */
+
#ifndef WINDOWS
fh = GNUNET_malloc (sizeof (struct GNUNET_DISK_FileHandle));
Modified: gnunet/src/util/os_priority.c
===================================================================
--- gnunet/src/util/os_priority.c 2013-05-22 10:15:45 UTC (rev 27244)
+++ gnunet/src/util/os_priority.c 2013-05-22 10:25:34 UTC (rev 27245)
@@ -722,6 +722,7 @@
}
if (0 != ret)
{
+ unsetenv (GNUNET_OS_CONTROL_PIPE);
gnunet_proc = GNUNET_malloc (sizeof (struct GNUNET_OS_Process));
gnunet_proc->pid = ret;
gnunet_proc->control_pipe = childpipe_write;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r27245 - gnunet/src/util,
gnunet <=