From 45b4dc92e293056a1c58c137ec4fe5a7241bf175 Mon Sep 17 00:00:00 2001 From: Radek Polak Date: Sun, 5 Feb 2012 00:02:22 +0100 Subject: [PATCH] show progress while routing --- gsm-voice-routing.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gsm-voice-routing.c b/gsm-voice-routing.c index 9529d0d..a2481a7 100644 --- a/gsm-voice-routing.c +++ b/gsm-voice-routing.c @@ -321,6 +321,15 @@ void log_with_timestamp(const char *msg) fprintf(logfile, "%d %d: %s\n", tp.tv_sec, tp.tv_nsec, msg); } +void show_progress() +{ + static int counter = 0; + char ch = "|\\-/"[(counter++) % 4]; + fputc(ch, logfile); + fputc('\b', logfile); + fflush(logfile); +} + int main() { int rc; @@ -412,7 +421,9 @@ int main() continue; } - if(!started) { + if (started) { + show_progress(); + } else { fprintf(logfile, "voice routing started\n"); started = 1; } -- 2.39.5