mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-03 02:43:23 +00:00
Port better to NFS unlink
I found this problem while looking into Bug#72641. * lib-src/etags.c (do_move_file): * lib-src/update-game-score.c (unlock_file): * src/androidvfs.c (android_hack_asset_fd_fallback): * src/filelock.c (current_lock_owner): Treat unlink as successful if it fails because the file wasn’t there. This can happen with some NFS implementations, due to its retrying over the network to get at-least-once semantics. Although most of Emacs’s calls to unlink were already doing this, a few instances were not.
This commit is contained in:
parent
8b36bfc553
commit
40eecd594a
4 changed files with 4 additions and 4 deletions
|
@ -7812,7 +7812,7 @@ do_move_file (const char *src_file, const char *dst_file)
|
|||
if (fclose (dst_f) == EOF)
|
||||
pfatal (dst_file);
|
||||
|
||||
if (unlink (src_file) == -1)
|
||||
if (unlink (src_file) < 0 && errno != ENOENT)
|
||||
pfatal ("unlink error");
|
||||
|
||||
return;
|
||||
|
|
|
@ -497,7 +497,7 @@ unlock_file (const char *filename, void *state)
|
|||
char *lockpath = (char *) state;
|
||||
int saved_errno = errno;
|
||||
int ret = unlink (lockpath);
|
||||
if (0 <= ret)
|
||||
if (! (ret < 0 && errno != ENOENT))
|
||||
errno = saved_errno;
|
||||
free (lockpath);
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue