From 2d672a8e5ce41108e0ab52cbeaef5ebcce94b67c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 23 Jun 2012 22:33:52 +0000 Subject: -LRN: Wincat: I've been experimenting with an alternative non-MSYS buildsystem for a while, and GNUNET_os_start_process() test kept failing due to lack of cat. Wincat is a minimal cat implementation in pure WinAPI. It's not named "cat.exe" to avoid clashing with MSYS cat (which can lead to some very weird issues). --- src/util/test_os_start_process.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/util/test_os_start_process.c') diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c index 5b9973250..3c30c75f3 100644 --- a/src/util/test_os_start_process.c +++ b/src/util/test_os_start_process.c @@ -113,7 +113,11 @@ run_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) const struct GNUNET_DISK_FileHandle *stdout_read_handle; const struct GNUNET_DISK_FileHandle *wh; +#if !WINDOWS GNUNET_asprintf (&fn, "cat"); +#else + GNUNET_asprintf (&fn, "w32cat"); +#endif hello_pipe_stdin = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_YES, GNUNET_NO); hello_pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); @@ -183,6 +187,12 @@ check_run () static int check_kill () { + char *fn; +#if !WINDOWS + GNUNET_asprintf (&fn, "cat"); +#else + GNUNET_asprintf (&fn, "w32cat"); +#endif hello_pipe_stdin = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_YES, GNUNET_NO); hello_pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); if ((hello_pipe_stdout == NULL) || (hello_pipe_stdin == NULL)) @@ -190,7 +200,7 @@ check_kill () return 1; } proc = - GNUNET_OS_start_process (GNUNET_YES, hello_pipe_stdin, hello_pipe_stdout, "cat", + GNUNET_OS_start_process (GNUNET_YES, hello_pipe_stdin, hello_pipe_stdout, fn, "gnunet-service-resolver", "-", NULL); sleep (1); /* give process time to start, so we actually use the pipe-kill mechanism! */ if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) @@ -210,6 +220,12 @@ check_kill () static int check_instant_kill () { + char *fn; +#if !WINDOWS + GNUNET_asprintf (&fn, "cat"); +#else + GNUNET_asprintf (&fn, "w32cat"); +#endif hello_pipe_stdin = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_YES, GNUNET_NO); hello_pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); if ((hello_pipe_stdout == NULL) || (hello_pipe_stdin == NULL)) @@ -217,7 +233,7 @@ check_instant_kill () return 1; } proc = - GNUNET_OS_start_process (GNUNET_YES, hello_pipe_stdin, hello_pipe_stdout, "cat", + GNUNET_OS_start_process (GNUNET_YES, hello_pipe_stdin, hello_pipe_stdout, fn, "gnunet-service-resolver", "-", NULL); if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) { -- cgit v1.2.3