diff --git a/src/utils/debuglog.cpp b/src/utils/debuglog.cpp index 5e581dc7..bfdc6f06 100644 --- a/src/utils/debuglog.cpp +++ b/src/utils/debuglog.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #ifdef INCLUDE_NEW_H #include @@ -84,8 +85,16 @@ class DLFWImpl { fp = stderr; } else { fp = fopen(filename, (truncate) ? "w" : "a"); - if (fp) + if (fp) { 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; }