flush logfile in case of crash

This commit is contained in:
ac-stef
2015-03-25 02:56:49 +01:00
parent 54ed91732e
commit 85f7a22e64
3 changed files with 6 additions and 3 deletions
+1
View File
@@ -422,6 +422,7 @@ struct filestream : stream
bool end() { return feof(file)!=0; }
long tell() { return ftell(file); }
bool seek(long offset, int whence) { return fseek(file, offset, whence) >= 0; }
void fflush() { if(file) ::fflush(file); }
int read(void *buf, int len) { return (int)fread(buf, 1, len, file); }
int write(const void *buf, int len) { return (int)fwrite(buf, 1, len, file); }
int getchar() { return fgetc(file); }