Browse Source

Use only one fprintf in console logging to minimise risk of overlap

master
ckolivas 11 years ago
parent
commit
10baacbeee
  1. 6
      src/ckpool.c

6
src/ckpool.c

@ -64,10 +64,10 @@ void logmsg(int loglevel, const char *fmt, ...) {
flock(logfd, LOCK_UN);
}
if (loglevel <= LOG_WARNING) {\
fprintf(stderr, "%s", buf);
if (loglevel <= LOG_ERR && errno != 0)
fprintf(stderr, " with errno %d: %s", errno, strerror(errno));
fprintf(stderr, "\n");
fprintf(stderr, "%s with errno %d: %s\n", buf, errno, strerror(errno));
else
fprintf(stderr, "%s\n", buf);
fflush(stderr);
}
free(buf);

Loading…
Cancel
Save