diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-06 08:48:47 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-06 08:48:47 +0000 |
commit | 29a8deb6ba442fe476accc22d1ca6fca654fe3f8 (patch) | |
tree | 29ad51b87aca4993f23b048dbbdd7c0eed49c2ed /src/util | |
parent | 7a741efb9be24b69bf7f44279274836cdba5601c (diff) | |
download | gnunet-29a8deb6ba442fe476accc22d1ca6fca654fe3f8.tar.gz gnunet-29a8deb6ba442fe476accc22d1ca6fca654fe3f8.zip |
LRN: Fix runtime logging test, since pipes work as intended
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/test_common_logging_runtime_loglevels.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c index e2864165a..045cb9751 100644 --- a/src/util/test_common_logging_runtime_loglevels.c +++ b/src/util/test_common_logging_runtime_loglevels.c | |||
@@ -47,7 +47,7 @@ static void runone (); | |||
47 | static void | 47 | static void |
48 | end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 48 | end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
49 | { | 49 | { |
50 | 50 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending phase %d, ok is %d\n", phase, ok); | |
51 | if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) | 51 | if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) |
52 | { | 52 | { |
53 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); | 53 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); |
@@ -84,7 +84,7 @@ read_output_line (int phase_from1, int phase_to1, int phase_from2, | |||
84 | if (!(phase >= phase_from1 && phase <= phase_to1) && | 84 | if (!(phase >= phase_from1 && phase <= phase_to1) && |
85 | !(phase >= phase_from2 && phase <= phase_to2)) | 85 | !(phase >= phase_from2 && phase <= phase_to2)) |
86 | return p; | 86 | return p; |
87 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to match '%c%s \\d\\r\\n' on %s", c, expect_level, p); | 87 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to match '%c%s \\d\\r\\n' on %s\n", c, expect_level, p); |
88 | for (i = 0; i < *len && !stop; i++) | 88 | for (i = 0; i < *len && !stop; i++) |
89 | { | 89 | { |
90 | switch (stage) | 90 | switch (stage) |
@@ -160,21 +160,13 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
160 | { | 160 | { |
161 | buf_ptr += rd; | 161 | buf_ptr += rd; |
162 | bytes += rd; | 162 | bytes += rd; |
163 | while (rd > 0) | 163 | #if VERBOSE |
164 | { | 164 | fprintf (stderr, "got %d bytes, reading more\n", rd); |
165 | rd = GNUNET_DISK_file_read (stdout_read_handle, buf_ptr, sizeof (buf) - bytes); | 165 | #endif |
166 | if (rd == -1 && errno == EWOULDBLOCK) | 166 | GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, |
167 | { | 167 | stdout_read_handle, &read_call, |
168 | GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, | 168 | (void *) stdout_read_handle); |
169 | stdout_read_handle, &read_call, | 169 | return; |
170 | (void *) stdout_read_handle); | ||
171 | return; | ||
172 | } | ||
173 | else if (rd == -1) | ||
174 | rd = 0; | ||
175 | buf_ptr += rd; | ||
176 | bytes += rd; | ||
177 | } | ||
178 | } | 170 | } |
179 | 171 | ||
180 | #if VERBOSE | 172 | #if VERBOSE |