]> git.tue.mpg.de Git - paraslash.git/commitdiff
daemon.c: Avoid setlinebuf().
authorAndre Noll <maan@tuebingen.mpg.de>
Fri, 2 Jan 2015 19:52:52 +0000 (19:52 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 12 Jan 2015 22:29:07 +0000 (23:29 +0100)
Using setvbuf() is equivalent, and more portable. See setbuf(3)
for details.

daemon.c

index b0d8fd744c8f7f0d208afd5f96ca03fe336ece16..8dd4d37e4824c8b8579a96cb338bb1ba980d8d4a 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -223,7 +223,8 @@ void daemon_open_log_or_die(void)
                        strerror(errno));
                exit(EXIT_FAILURE);
        }
-       setlinebuf(me->logfile);
+       /* equivalent to setlinebuf(), but portable */
+       setvbuf(me->logfile, NULL, _IOLBF, 0);
 }
 
 /**