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:
magnum
2016-01-29 16:48:19 +01:00
parent 2a160b2706
commit ce170ea980
4 changed files with 47 additions and 1 deletions
+8
View File
@@ -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