diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-05-22 10:25:34 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-05-22 10:25:34 +0000 |
commit | 73fd3edc250a6f7df402c63820774b5cbd1a73b1 (patch) | |
tree | 114297bc26c84b089cf69ff8557357571ac9037e /src/util/disk.c | |
parent | 340eac62af8df19b062fae89180684c5a02c2d6a (diff) | |
download | gnunet-73fd3edc250a6f7df402c63820774b5cbd1a73b1.tar.gz gnunet-73fd3edc250a6f7df402c63820774b5cbd1a73b1.zip |
-need to unset control pipe on OSX, check for bad FD in environment variable
Diffstat (limited to 'src/util/disk.c')
-rw-r--r-- | src/util/disk.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util/disk.c b/src/util/disk.c index ccd930907..6dca6db54 100644 --- a/src/util/disk.c +++ b/src/util/disk.c | |||
@@ -1930,13 +1930,17 @@ GNUNET_DISK_get_handle_from_w32_handle (HANDLE osfh) | |||
1930 | * Get a handle from a native integer FD. | 1930 | * Get a handle from a native integer FD. |
1931 | * | 1931 | * |
1932 | * @param fno native integer file descriptor | 1932 | * @param fno native integer file descriptor |
1933 | * @return file handle corresponding to the descriptor | 1933 | * @return file handle corresponding to the descriptor, NULL on error |
1934 | */ | 1934 | */ |
1935 | struct GNUNET_DISK_FileHandle * | 1935 | struct GNUNET_DISK_FileHandle * |
1936 | GNUNET_DISK_get_handle_from_int_fd (int fno) | 1936 | GNUNET_DISK_get_handle_from_int_fd (int fno) |
1937 | { | 1937 | { |
1938 | struct GNUNET_DISK_FileHandle *fh; | 1938 | struct GNUNET_DISK_FileHandle *fh; |
1939 | 1939 | ||
1940 | if ( (((off_t) -1) == lseek (fno, 0, SEEK_CUR)) && | ||
1941 | (EBADF == errno) ) | ||
1942 | return NULL; /* invalid FD */ | ||
1943 | |||
1940 | #ifndef WINDOWS | 1944 | #ifndef WINDOWS |
1941 | fh = GNUNET_malloc (sizeof (struct GNUNET_DISK_FileHandle)); | 1945 | fh = GNUNET_malloc (sizeof (struct GNUNET_DISK_FileHandle)); |
1942 | 1946 | ||