From: Radek Polak Date: Sat, 4 Feb 2012 23:02:22 +0000 (+0100) Subject: show progress while routing X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=45b4dc92e293056a1c58c137ec4fe5a7241bf175;p=gta04-gsm-voice-routing.git show progress while routing --- 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; }