diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/util/disk.c | 6 | ||||
-rw-r--r-- | src/util/os_priority.c | 1 |
2 files changed, 6 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 | ||
diff --git a/src/util/os_priority.c b/src/util/os_priority.c index e0e1614f4..12dba6a6b 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c | |||
@@ -722,6 +722,7 @@ start_process (int pipe_control, | |||
722 | } | 722 | } |
723 | if (0 != ret) | 723 | if (0 != ret) |
724 | { | 724 | { |
725 | unsetenv (GNUNET_OS_CONTROL_PIPE); | ||
725 | gnunet_proc = GNUNET_malloc (sizeof (struct GNUNET_OS_Process)); | 726 | gnunet_proc = GNUNET_malloc (sizeof (struct GNUNET_OS_Process)); |
726 | gnunet_proc->pid = ret; | 727 | gnunet_proc->pid = ret; |
727 | gnunet_proc->control_pipe = childpipe_write; | 728 | gnunet_proc->control_pipe = childpipe_write; |