aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_os_start_process.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-23 22:33:52 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-23 22:33:52 +0000
commit2d672a8e5ce41108e0ab52cbeaef5ebcce94b67c (patch)
tree4a4f91b6b69d5bf2463f963924bc444caafd5ba1 /src/util/test_os_start_process.c
parentde8fb70966c0eb3b0a8c7207a19a34b1ee24629f (diff)
downloadgnunet-2d672a8e5ce41108e0ab52cbeaef5ebcce94b67c.tar.gz
gnunet-2d672a8e5ce41108e0ab52cbeaef5ebcce94b67c.zip
-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).
Diffstat (limited to 'src/util/test_os_start_process.c')
-rw-r--r--src/util/test_os_start_process.c20
1 files changed, 18 insertions, 2 deletions
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)
113 const struct GNUNET_DISK_FileHandle *stdout_read_handle; 113 const struct GNUNET_DISK_FileHandle *stdout_read_handle;
114 const struct GNUNET_DISK_FileHandle *wh; 114 const struct GNUNET_DISK_FileHandle *wh;
115 115
116#if !WINDOWS
116 GNUNET_asprintf (&fn, "cat"); 117 GNUNET_asprintf (&fn, "cat");
118#else
119 GNUNET_asprintf (&fn, "w32cat");
120#endif
117 121
118 hello_pipe_stdin = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_YES, GNUNET_NO); 122 hello_pipe_stdin = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_YES, GNUNET_NO);
119 hello_pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); 123 hello_pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES);
@@ -183,6 +187,12 @@ check_run ()
183static int 187static int
184check_kill () 188check_kill ()
185{ 189{
190 char *fn;
191#if !WINDOWS
192 GNUNET_asprintf (&fn, "cat");
193#else
194 GNUNET_asprintf (&fn, "w32cat");
195#endif
186 hello_pipe_stdin = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_YES, GNUNET_NO); 196 hello_pipe_stdin = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_YES, GNUNET_NO);
187 hello_pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); 197 hello_pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES);
188 if ((hello_pipe_stdout == NULL) || (hello_pipe_stdin == NULL)) 198 if ((hello_pipe_stdout == NULL) || (hello_pipe_stdin == NULL))
@@ -190,7 +200,7 @@ check_kill ()
190 return 1; 200 return 1;
191 } 201 }
192 proc = 202 proc =
193 GNUNET_OS_start_process (GNUNET_YES, hello_pipe_stdin, hello_pipe_stdout, "cat", 203 GNUNET_OS_start_process (GNUNET_YES, hello_pipe_stdin, hello_pipe_stdout, fn,
194 "gnunet-service-resolver", "-", NULL); 204 "gnunet-service-resolver", "-", NULL);
195 sleep (1); /* give process time to start, so we actually use the pipe-kill mechanism! */ 205 sleep (1); /* give process time to start, so we actually use the pipe-kill mechanism! */
196 if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) 206 if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
@@ -210,6 +220,12 @@ check_kill ()
210static int 220static int
211check_instant_kill () 221check_instant_kill ()
212{ 222{
223 char *fn;
224#if !WINDOWS
225 GNUNET_asprintf (&fn, "cat");
226#else
227 GNUNET_asprintf (&fn, "w32cat");
228#endif
213 hello_pipe_stdin = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_YES, GNUNET_NO); 229 hello_pipe_stdin = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_YES, GNUNET_NO);
214 hello_pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); 230 hello_pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES);
215 if ((hello_pipe_stdout == NULL) || (hello_pipe_stdin == NULL)) 231 if ((hello_pipe_stdout == NULL) || (hello_pipe_stdin == NULL))
@@ -217,7 +233,7 @@ check_instant_kill ()
217 return 1; 233 return 1;
218 } 234 }
219 proc = 235 proc =
220 GNUNET_OS_start_process (GNUNET_YES, hello_pipe_stdin, hello_pipe_stdout, "cat", 236 GNUNET_OS_start_process (GNUNET_YES, hello_pipe_stdin, hello_pipe_stdout, fn,
221 "gnunet-service-resolver", "-", NULL); 237 "gnunet-service-resolver", "-", NULL);
222 if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) 238 if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
223 { 239 {