static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static GNUNET_SCHEDULER_TaskIdentifier read_task;
+
static void
runone (void);
GNUNET_OS_process_destroy (proc);
proc = NULL;
}
+ if (GNUNET_SCHEDULER_NO_TASK != read_task)
+ {
+ GNUNET_SCHEDULER_cancel (read_task);
+ read_task = GNUNET_SCHEDULER_NO_TASK;
+ }
GNUNET_DISK_pipe_close (pipe_stdout);
if (ok == 1)
{
static void
read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- struct GNUNET_DISK_FileHandle *stdout_read_handle = cls;
+ const struct GNUNET_DISK_FileHandle *stdout_read_handle = cls;
char level[8];
long delay;
long delays[8];
int rd;
+ read_task = GNUNET_SCHEDULER_NO_TASK;
rd = GNUNET_DISK_file_read (stdout_read_handle, buf_ptr,
sizeof (buf) - bytes);
if (rd > 0)
#if VERBOSE
FPRINTF (stderr, "got %d bytes, reading more\n", rd);
#endif
- GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
- stdout_read_handle, &read_call,
- (void *) stdout_read_handle);
+ read_task = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
+ stdout_read_handle, &read_call,
+ (void*) stdout_read_handle);
return;
}
break;
}
- proc = GNUNET_OS_start_process (GNUNET_NO, NULL, pipe_stdout,
+ proc = GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, pipe_stdout,
#if MINGW
"test_common_logging_dummy",
#else
"./test_common_logging_dummy",
#endif
"test_common_logging_dummy", NULL);
+ GNUNET_assert (NULL != proc);
putenv ("GNUNET_FORCE_LOG=");
putenv ("GNUNET_LOG=");
buf_ptr = buf;
memset (&buf, 0, sizeof (buf));
- GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
- stdout_read_handle, &read_call,
- (void *) stdout_read_handle);
+ read_task = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
+ stdout_read_handle, &read_call,
+ (void*) stdout_read_handle);
}
static void