mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
logit: Sync each log entry to file
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -125,11 +125,13 @@ reopen:
|
||||
|
||||
if (buf[0]) {
|
||||
fprintf(fp, "%s\n", buf);
|
||||
fsync(fileno(fp));
|
||||
if (checksz(fp, sz))
|
||||
return logrotate(logfile, num, sz);
|
||||
} else {
|
||||
while ((fgets(buf, len, stdin))) {
|
||||
fputs(buf, fp);
|
||||
fsync(fileno(fp));
|
||||
|
||||
if (checksz(fp, sz)) {
|
||||
logrotate(logfile, num, sz);
|
||||
|
||||
Reference in New Issue
Block a user