{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending phase %d, ok is %d\n", phase,
ok);
- if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
+ if (NULL != proc)
{
- GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
+ if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
+ {
+ GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
+ }
+ GNUNET_OS_process_wait (proc);
+ GNUNET_OS_process_destroy (proc);
+ proc = NULL;
}
- GNUNET_OS_process_wait (proc);
- GNUNET_OS_process_close (proc);
- proc = NULL;
GNUNET_DISK_pipe_close (pipe_stdout);
if (ok == 1)
{
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=");
runone ();
}
-/**
- * Main method, starts scheduler with task1,
- * checks that "ok" is correct at the end.
- */
-static int
-check ()
-{
- ok = 1;
- GNUNET_SCHEDULER_run (&task, &ok);
- return ok;
-}
-
int
main (int argc, char *argv[])
{
- int ret;
-
GNUNET_log_setup ("test-common-logging-runtime-loglevels",
-#if VERBOSE
- "DEBUG",
-#else
"WARNING",
-#endif
NULL);
- ret = check ();
-
- return ret;
+ ok = 1;
+ GNUNET_SCHEDULER_run (&task, &ok);
+ return ok;
}
/* end of test_common_logging_runtime_loglevels.c */