set O_APPEND on log fd just in case
This commit is contained in:
parent
e241972c2c
commit
3acac5542f
@ -21,6 +21,7 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
#ifdef INCLUDE_NEW_H
|
#ifdef INCLUDE_NEW_H
|
||||||
#include <new.h>
|
#include <new.h>
|
||||||
@ -84,8 +85,16 @@ class DLFWImpl {
|
|||||||
fp = stderr;
|
fp = stderr;
|
||||||
} else {
|
} else {
|
||||||
fp = fopen(filename, (truncate) ? "w" : "a");
|
fp = fopen(filename, (truncate) ? "w" : "a");
|
||||||
if (fp)
|
if (fp) {
|
||||||
setvbuf(fp, 0, _IOLBF, 0);
|
setvbuf(fp, 0, _IOLBF, 0);
|
||||||
|
#ifdef O_APPEND
|
||||||
|
{
|
||||||
|
int flgs = 0;
|
||||||
|
fcntl(fileno(fp), F_GETFL, &flgs);
|
||||||
|
fcntl(fileno(fp), F_SETFL, flgs|O_APPEND);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user