From: Nils Durner Date: Sat, 17 Apr 2010 09:21:29 +0000 (+0000) Subject: don't bypass GNUnet IO X-Git-Tag: initial-import-from-subversion-38251~22115 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=740a0bed33427d828fa0daedd331a5411d8b57a7;p=oweals%2Fgnunet.git don't bypass GNUnet IO --- diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c index 5a47c2f5c..f768e3ccf 100644 --- a/src/util/test_os_start_process.c +++ b/src/util/test_os_start_process.c @@ -24,11 +24,6 @@ * This testcase simply calls the os start process code * giving a file descriptor to write stdout to. If the * correct data "HELLO" is read then all is well. - * - * TODO: This test case will not work on windows because - * there is no cat (unless there is). Perhaps we should - * add a gnunet_cat program/test program to util so we can - * adequately test this functionality on windows? */ #include "platform.h" #include "gnunet_common.h" @@ -107,8 +102,6 @@ static void task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { char *fn; - int fd_stdout; - int fd_stdin; const struct GNUNET_DISK_FileHandle *stdout_read_handle; @@ -132,13 +125,9 @@ task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_DISK_pipe_close_end(hello_pipe_stdout, GNUNET_DISK_PIPE_END_WRITE); /* Close the read end of the write pipe */ GNUNET_DISK_pipe_close_end(hello_pipe_stdin, GNUNET_DISK_PIPE_END_READ); - /* Get the FD to read from */ - GNUNET_DISK_internal_file_handle_ (GNUNET_DISK_pipe_handle(hello_pipe_stdout, GNUNET_DISK_PIPE_END_READ), &fd_stdout, sizeof (int)); - /* Get the FD to write to */ - GNUNET_DISK_internal_file_handle_ (GNUNET_DISK_pipe_handle(hello_pipe_stdin, GNUNET_DISK_PIPE_END_WRITE), &fd_stdin, sizeof (int)); /* Write the test_phrase to the cat process */ - if (write(fd_stdin, test_phrase, strlen(test_phrase) + 1) == GNUNET_SYSERR) + if (GNUNET_DISK_file_write(hello_pipe_stdin, test_phrase, strlen(test_phrase) + 1) != GNUNET_YES) { ok = 1; return;