From 97d4ba3a0e46302c421acf36d524916fec21967e Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Wed, 14 Jun 2017 18:03:35 -0700 Subject: [PATCH] Announce uRaid entry on stderr in case stdout has been redirected to collect trace output. Also fflush() stdout & stderr so that we see any buffered output when we enter. modified: src/common.c --- src/common.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/common.c b/src/common.c index 06beddf..bc84bb4 100644 --- a/src/common.c +++ b/src/common.c @@ -80,16 +80,18 @@ LispPTR Uraid_mess = NIL; int error(char *cp) { char *ptr; if (device_before_raid() < 0) { - printf("Can't Enter URAID.\n"); + fprintf(stderr, "Can't Enter URAID.\n"); exit(-1); } /* comm read */ URaid_errmess = cp; - printf("\n*Error* %s\n", cp); + fprintf(stderr, "\n*Error* %s\n", cp); fflush(stdin); - printf("Enter the URaid\n"); + fprintf(stderr, "Enter the URaid\n"); print(Uraid_mess); putchar('\n'); + /* XXX: make sure output is flushed so we can see where we are */ + fflush(stdout); fflush(stderr); URaid_currentFX = URMAXFXNUM + 1; memset(URaid_FXarray, 0, URMAXFXNUM * 4); #ifndef DOS @@ -114,6 +116,8 @@ uraidloop: URaid_argnum = sscanf(URaid_inputstring, "%1s%s%s", &URaid_comm, URaid_arg1, URaid_arg2); if (uraid_commands() == NIL) break; + /* XXX: make sure output is flushed so we can see where we are */ + fflush(stdout); fflush(stderr); } /* for end */ /**TopOfStack = NIL;if error is called from subr TOS will be set NIL**/