*access_fd = -1;
return -1;
}
+ if(setvbuf(*access_fp, NULL, _IOLBF, 0) != 0)
+ error("Cannot set line buffering on access.log");
}
}
dup2(output_fd, STDOUT_FILENO);
close(output_fd);
}
+
+ if(setvbuf(stdout, NULL, _IOLBF, 0) != 0)
+ error("Cannot set line buffering on debug.log");
+
output_fd = -1;
}
else dup2(dev_null, STDOUT_FILENO);
dup2(error_fd, STDERR_FILENO);
close(error_fd);
}
+
+ if(setvbuf(stderr, NULL, _IOLBF, 0) != 0)
+ error("Cannot set line buffering on error.log");
+
error_fd = -1;
}
else dup2(dev_null, STDERR_FILENO);
vfprintf( stdout, fmt, args );
va_end( args );
fprintf(stdout, "\n");
- fflush( stdout );
+ // fflush( stdout );
if(output_log_syslog) {
va_start( args, fmt );
vfprintf( stdaccess, fmt, args );
va_end( args );
fprintf( stdaccess, "\n");
- fflush( stdaccess );
+ // fflush( stdaccess );
}
if(access_log_syslog) {