From: Florian Dold Date: Wed, 13 Jun 2012 12:41:21 +0000 (+0000) Subject: changed how gnunet-testing-run-service communicates over stdin/stdout X-Git-Tag: initial-import-from-subversion-38251~13092 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6716dcd5cbf484b797b3d4ac446335241c0d4a83;p=oweals%2Fgnunet.git changed how gnunet-testing-run-service communicates over stdin/stdout --- diff --git a/src/testing/gnunet-testing-run-service.c b/src/testing/gnunet-testing-run-service.c index fe0028971..c9e115260 100644 --- a/src/testing/gnunet-testing-run-service.c +++ b/src/testing/gnunet-testing-run-service.c @@ -83,14 +83,14 @@ stdin_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (GNUNET_SCHEDULER_REASON_READ_READY & tc->reason) { c = getchar (); - if (EOF == c) + if (EOF == c || 'q' == c) { tid = GNUNET_SCHEDULER_NO_TASK; cleanup (); } else { - if (c == 'r') + if ('r' == c) { GNUNET_TESTING_peer_stop(my_peer); GNUNET_TESTING_peer_start(my_peer); @@ -128,7 +128,7 @@ testing_main (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, return; } - printf("%s\n", tmpfilename); + printf("started\n%s\n", tmpfilename); fflush(stdout); GNUNET_break(NULL != GNUNET_SIGNAL_handler_install(SIGTERM, &cleanup)); @@ -179,8 +179,14 @@ main (int argc, char *const *argv) ret = GNUNET_TESTING_service_run_restartable ("gnunet_service_test", argv[1], NULL, &testing_main, NULL); - - printf ("bye\n"); - + if (ret) + { + printf ("error\n"); + } + else + { + printf ("bye\n"); + } return ret; } +