diff options
author | Nils Durner <durner@gnunet.org> | 2010-04-17 10:35:44 +0000 |
---|---|---|
committer | Nils Durner <durner@gnunet.org> | 2010-04-17 10:35:44 +0000 |
commit | 25e132881a18faed1e9438b882367df0dc4e090f (patch) | |
tree | b2886e0d1548eb92e5a3d3a3a4bc771b97cb838c | |
parent | 740a0bed33427d828fa0daedd331a5411d8b57a7 (diff) | |
download | gnunet-25e132881a18faed1e9438b882367df0dc4e090f.tar.gz gnunet-25e132881a18faed1e9438b882367df0dc4e090f.zip |
MinGW pipes
-rw-r--r-- | src/util/disk.c | 3 | ||||
-rw-r--r-- | src/util/test_os_start_process.c | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/util/disk.c b/src/util/disk.c index 588ecae3c..233802569 100644 --- a/src/util/disk.c +++ b/src/util/disk.c | |||
@@ -1688,7 +1688,6 @@ GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, | |||
1688 | int ret = GNUNET_OK; | 1688 | int ret = GNUNET_OK; |
1689 | int save; | 1689 | int save; |
1690 | 1690 | ||
1691 | /* FIXME: What can we safely set HANDLE to once we've closed an end, NULL? */ | ||
1692 | #ifdef MINGW | 1691 | #ifdef MINGW |
1693 | if (end == GNUNET_DISK_PIPE_END_READ) | 1692 | if (end == GNUNET_DISK_PIPE_END_READ) |
1694 | { | 1693 | { |
@@ -1697,6 +1696,7 @@ GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, | |||
1697 | SetErrnoFromWinError (GetLastError ()); | 1696 | SetErrnoFromWinError (GetLastError ()); |
1698 | ret = GNUNET_SYSERR; | 1697 | ret = GNUNET_SYSERR; |
1699 | } | 1698 | } |
1699 | p->fd[0]->h = INVALID_HANDLE_VALUE; | ||
1700 | } | 1700 | } |
1701 | else if (end == GNUNET_DISK_PIPE_END_WRITE) | 1701 | else if (end == GNUNET_DISK_PIPE_END_WRITE) |
1702 | { | 1702 | { |
@@ -1705,6 +1705,7 @@ GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, | |||
1705 | SetErrnoFromWinError (GetLastError ()); | 1705 | SetErrnoFromWinError (GetLastError ()); |
1706 | ret = GNUNET_SYSERR; | 1706 | ret = GNUNET_SYSERR; |
1707 | } | 1707 | } |
1708 | p->fd[1]->h = INVALID_HANDLE_VALUE; | ||
1708 | } | 1709 | } |
1709 | save = errno; | 1710 | save = errno; |
1710 | #else | 1711 | #else |
diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c index f768e3ccf..3b34beedf 100644 --- a/src/util/test_os_start_process.c +++ b/src/util/test_os_start_process.c | |||
@@ -102,8 +102,8 @@ static void | |||
102 | task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 102 | task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
103 | { | 103 | { |
104 | char *fn; | 104 | char *fn; |
105 | |||
106 | const struct GNUNET_DISK_FileHandle *stdout_read_handle; | 105 | const struct GNUNET_DISK_FileHandle *stdout_read_handle; |
106 | struct GNUNET_DISK_FileHandle *wh; | ||
107 | 107 | ||
108 | GNUNET_asprintf(&fn, "cat"); | 108 | GNUNET_asprintf(&fn, "cat"); |
109 | 109 | ||
@@ -126,8 +126,10 @@ task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
126 | /* Close the read end of the write pipe */ | 126 | /* Close the read end of the write pipe */ |
127 | GNUNET_DISK_pipe_close_end(hello_pipe_stdin, GNUNET_DISK_PIPE_END_READ); | 127 | GNUNET_DISK_pipe_close_end(hello_pipe_stdin, GNUNET_DISK_PIPE_END_READ); |
128 | 128 | ||
129 | wh = GNUNET_DISK_pipe_handle (hello_pipe_stdin, GNUNET_DISK_PIPE_END_WRITE); | ||
130 | |||
129 | /* Write the test_phrase to the cat process */ | 131 | /* Write the test_phrase to the cat process */ |
130 | if (GNUNET_DISK_file_write(hello_pipe_stdin, test_phrase, strlen(test_phrase) + 1) != GNUNET_YES) | 132 | if (GNUNET_DISK_file_write(wh, test_phrase, strlen(test_phrase) + 1) != GNUNET_YES) |
131 | { | 133 | { |
132 | ok = 1; | 134 | ok = 1; |
133 | return; | 135 | return; |