diff options
Diffstat (limited to 'src/util/test_common_logging_runtime_loglevels.c')
-rw-r--r-- | src/util/test_common_logging_runtime_loglevels.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c index 4c6ae0039..7be48d0f9 100644 --- a/src/util/test_common_logging_runtime_loglevels.c +++ b/src/util/test_common_logging_runtime_loglevels.c | |||
@@ -42,6 +42,8 @@ static struct GNUNET_DISK_PipeHandle *pipe_stdout; | |||
42 | 42 | ||
43 | static GNUNET_SCHEDULER_TaskIdentifier die_task; | 43 | static GNUNET_SCHEDULER_TaskIdentifier die_task; |
44 | 44 | ||
45 | static GNUNET_SCHEDULER_TaskIdentifier read_task; | ||
46 | |||
45 | static void | 47 | static void |
46 | runone (void); | 48 | runone (void); |
47 | 49 | ||
@@ -60,6 +62,11 @@ end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
60 | GNUNET_OS_process_destroy (proc); | 62 | GNUNET_OS_process_destroy (proc); |
61 | proc = NULL; | 63 | proc = NULL; |
62 | } | 64 | } |
65 | if (GNUNET_SCHEDULER_NO_TASK != read_task) | ||
66 | { | ||
67 | GNUNET_SCHEDULER_cancel (read_task); | ||
68 | read_task = GNUNET_SCHEDULER_NO_TASK; | ||
69 | } | ||
63 | GNUNET_DISK_pipe_close (pipe_stdout); | 70 | GNUNET_DISK_pipe_close (pipe_stdout); |
64 | if (ok == 1) | 71 | if (ok == 1) |
65 | { | 72 | { |
@@ -167,6 +174,7 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
167 | long delays[8]; | 174 | long delays[8]; |
168 | int rd; | 175 | int rd; |
169 | 176 | ||
177 | read_task = GNUNET_SCHEDULER_NO_TASK; | ||
170 | rd = GNUNET_DISK_file_read (stdout_read_handle, buf_ptr, | 178 | rd = GNUNET_DISK_file_read (stdout_read_handle, buf_ptr, |
171 | sizeof (buf) - bytes); | 179 | sizeof (buf) - bytes); |
172 | if (rd > 0) | 180 | if (rd > 0) |
@@ -176,9 +184,9 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
176 | #if VERBOSE | 184 | #if VERBOSE |
177 | FPRINTF (stderr, "got %d bytes, reading more\n", rd); | 185 | FPRINTF (stderr, "got %d bytes, reading more\n", rd); |
178 | #endif | 186 | #endif |
179 | GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, | 187 | read_task = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, |
180 | stdout_read_handle, &read_call, | 188 | stdout_read_handle, &read_call, |
181 | (void *) stdout_read_handle); | 189 | stdout_read_handle); |
182 | return; | 190 | return; |
183 | } | 191 | } |
184 | 192 | ||
@@ -343,9 +351,9 @@ runone () | |||
343 | buf_ptr = buf; | 351 | buf_ptr = buf; |
344 | memset (&buf, 0, sizeof (buf)); | 352 | memset (&buf, 0, sizeof (buf)); |
345 | 353 | ||
346 | GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, | 354 | read_task = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, |
347 | stdout_read_handle, &read_call, | 355 | stdout_read_handle, &read_call, |
348 | (void *) stdout_read_handle); | 356 | stdout_read_handle); |
349 | } | 357 | } |
350 | 358 | ||
351 | static void | 359 | static void |