Acquire an exclusive lock before writing to any file. Note that in
some cases we never explicitly unlock a file because fclose will do it implicitly. Closes #172.
This commit is contained in:
@@ -1832,6 +1832,14 @@ char *logfile_generate_topid ();
|
||||
char *logfile_generate_subid ();
|
||||
void logfile_append (const char *fmt, ...);
|
||||
|
||||
#if F_SETLKW
|
||||
void lock_file (FILE *fp);
|
||||
void unlock_file (FILE *fp);
|
||||
#else
|
||||
#define lock_file(dummy) {}
|
||||
#define unlock_file(dummy) {}
|
||||
#endif
|
||||
|
||||
#ifdef _WIN
|
||||
void fsync (int fd);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user