Browse Source

Add clear line to console_log only if stderr is going to console.

master
Con Kolivas 8 years ago
parent
commit
b6215001cf
  1. 5
      src/ckpool.c

5
src/ckpool.c

@ -57,7 +57,10 @@ static bool open_logfile(ckpool_t *ckp)
* on any delays. */
static void console_log(ckpool_t __maybe_unused *ckp, char *msg)
{
fprintf(stderr, "\33[2K\r%s", msg);
/* Add clear line only if stderr is going to console */
if (isatty(fileno(stderr)))
fprintf(stderr, "\33[2K\r");
fprintf(stderr, "%s", msg);
fflush(stderr);
free(msg);

Loading…
Cancel
Save