console.c (LOG_Init): Removed the O_APPEND flag when opening the log file.

It was a legacy from Quake who used to open and close the log file on every
write. Commented out the unlink() call and added O_TRUNC to the open flags.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@476 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2011-08-03 19:30:37 +00:00
parent 162f18573e
commit 0c82fbc646

View file

@ -1261,9 +1261,9 @@ void LOG_Init (quakeparms_t *parms)
strftime (session, sizeof(session), "%m/%d/%Y %H:%M:%S", localtime(&inittime));
q_snprintf (logfilename, sizeof(logfilename), "%s/qconsole.log", parms->basedir);
unlink (logfilename);
// unlink (logfilename);
log_fd = open (logfilename, O_WRONLY | O_CREAT | O_APPEND, 0666);
log_fd = open (logfilename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
if (log_fd == -1)
{
fprintf (stderr, "Error: Unable to create log file %s\n", logfilename);