diff options
| author | Paul Eggert | 2013-03-02 12:41:53 -0800 |
|---|---|---|
| committer | Paul Eggert | 2013-03-02 12:41:53 -0800 |
| commit | b5029e230d10ea412e4ff1d4867a0c884d130039 (patch) | |
| tree | 98c424b27b043f8289e215d06ec6a09de6c7e2c3 /src/ChangeLog | |
| parent | 06b583dec7cbde714c8fb991a1e123f612b66e3a (diff) | |
| download | emacs-b5029e230d10ea412e4ff1d4867a0c884d130039.tar.gz emacs-b5029e230d10ea412e4ff1d4867a0c884d130039.zip | |
The lock for FILE is now .#FILE or .#-FILE.
The old approach, which fell back on DIR/.#FILE.0 through
DIR/.#FILE.9, had race conditions that could not be easily fixed.
If DIR/.#FILE is a non-symlink file, Emacs now does not create a
lock file for DIR/FILE; that is, DIR/FILE is no longer partly
protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
because the locking mechanism was never reliable in that case).
This patch fixes this and other bugs discovered by a code
inspection that was prompted by
<http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
to avoid interoperability problems between the MS-Windows and
non-MS-Windows implementations. MS-Windows and non-MS-Windows
instances of Emacs now ignore each others' locks.
* etc/NEWS: Document this.
* src/filelock.c (defined_WINDOWSNT): New constant.
(MAKE_LOCK_NAME, fill_in_lock_file_name):
Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
regular files on MS-Windows hosts.
(MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
Use SAFE_ALLOCA to avoid problems with long file names.
(MAX_LFINFO): Now a local constant, not a global macro.
(IS_LOCK_FILE): Remove.
(lock_file_1): Don't inspect errno if symlink call succeeds;
that's not portable.
(lock_file): Document that this function can return if lock
creation fails.
Fixes: debbugs:13807
Diffstat (limited to 'src/ChangeLog')
| -rw-r--r-- | src/ChangeLog | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d8b2833b2fa..7afae3df6f5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,33 @@ | |||
| 1 | 2013-03-02 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | The lock for FILE is now .#FILE or .#-FILE (Bug#13807). | ||
| 4 | The old approach, which fell back on DIR/.#FILE.0 through | ||
| 5 | DIR/.#FILE.9, had race conditions that could not be easily fixed. | ||
| 6 | If DIR/.#FILE is a non-symlink file, Emacs now does not create a | ||
| 7 | lock file for DIR/FILE; that is, DIR/FILE is no longer partly | ||
| 8 | protected by a lock if DIR/.#FILE is a non-symlink file ("partly" | ||
| 9 | because the locking mechanism was never reliable in that case). | ||
| 10 | This patch fixes this and other bugs discovered by a code | ||
| 11 | inspection that was prompted by | ||
| 12 | <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>. | ||
| 13 | Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows, | ||
| 14 | to avoid interoperability problems between the MS-Windows and | ||
| 15 | non-MS-Windows implementations. MS-Windows and non-MS-Windows | ||
| 16 | instances of Emacs now ignore each others' locks. | ||
| 17 | * filelock.c (defined_WINDOWSNT): New constant. | ||
| 18 | (MAKE_LOCK_NAME, fill_in_lock_file_name): | ||
| 19 | Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create | ||
| 20 | DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE | ||
| 21 | regular files on MS-Windows hosts. | ||
| 22 | (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p): | ||
| 23 | Use SAFE_ALLOCA to avoid problems with long file names. | ||
| 24 | (MAX_LFINFO): Now a local constant, not a global macro. | ||
| 25 | (IS_LOCK_FILE): Remove. | ||
| 26 | (lock_file_1): Don't inspect errno if symlink call succeeds; | ||
| 27 | that's not portable. | ||
| 28 | (lock_file): Document that this function can return if lock | ||
| 29 | creation fails. | ||
| 30 | |||
| 1 | 2013-03-02 Andreas Schwab <schwab@linux-m68k.org> | 31 | 2013-03-02 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 32 | ||
| 3 | * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734) | 33 | * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734) |