Implement fcntl(2) file locking
If you run a server, then you know of the somewhat annoying perm_lock errors that creep up, requiring your attention before anyone else can start a game. This patch properly implements fcntl(2) locking on systems that can handle it (*nix systems), that results in the lock being automatically released on program termination, whether abnormal or not. Original patch by Drew Streib, update by Edoardo Spadolini
This commit is contained in:
@@ -217,6 +217,12 @@
|
||||
|
||||
#define FCMASK 0660 /* file creation mask */
|
||||
|
||||
/* fcntl(2) is a POSIX-portable call for manipulating file descriptors.
|
||||
* Comment out the USE_FCNTL if for some reason you have a strange
|
||||
* OS/filesystem combination for which fcntl(2) does not work. */
|
||||
#ifdef POSIX_TYPES
|
||||
# define USE_FCNTL
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The remainder of the file should not need to be changed.
|
||||
|
||||
Reference in New Issue
Block a user