summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-08-01 17:24:28 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2017-08-01 17:24:50 -0700
commit1a65afb7ecc2a52127d6164bad19313440237f9d (patch)
treecebf29b8dbbcec14fbdb1e8c13b143334c8fbca6 /src/fileio.c
parentf74164a845eff579635da0a1267514ef9d040ad2 (diff)
downloademacs-1a65afb7ecc2a52127d6164bad19313440237f9d.tar.gz
Don’t worry about unlink if errno == ENOENT
* src/fileio.c (Fdelete_file): * src/keyboard.c (Fopen_dribble_file): Do not report failure to remove a file if unlink fails with errno == ENOENT. This can happen even if Emacs is the only program removing the file, in case an NFS cache overflows. The file does not exist if errno == ENOENT, so it is OK to proceed.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c
index a57d50b24e0..7531214fe45 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2216,7 +2216,7 @@ With a prefix argument, TRASH is nil. */)
encoded_file = ENCODE_FILE (filename);
- if (unlink (SSDATA (encoded_file)) < 0)
+ if (unlink (SSDATA (encoded_file)) != 0 && errno != ENOENT)
report_file_error ("Removing old name", filename);
return Qnil;
}