diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2019-09-17 19:18:14 -0700 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-09-17 19:24:38 -0700 |
| commit | 9dc306b1db08196684d05a474148e16305adbad0 (patch) | |
| tree | 78a401e0156a34ef1d2ae99acad31fb3ad9cb806 /src/emacs.c | |
| parent | ae3edf0ac3f1e893338917497b55859d6aca7d42 (diff) | |
| download | emacs-9dc306b1db08196684d05a474148e16305adbad0.tar.gz | |
Improve reporting of I/O, access errors
Signal an error for file-oriented errors that are not tame
errors like ENOENT and ENOTDIR (Bug#37389).
Do this for primitives exposed to Lisp; the lower
level internal C API merely makes errno values available
to higher-level C code.
* doc/lispref/files.texi (Testing Accessibility)
(File Attributes, Extended Attributes): Do not say that the
functions return nil when the return value cannot be determined.
* etc/NEWS: Mention the change.
* src/dired.c (Ffile_attributes): Fix doc string confusion
about opening a file vs getting its attributes.
(file_attributes): Signal serious errors.
* src/fileio.c (check_existing, check_executable)
(check_writable): Remove. All callers changed to use
check_file_access or file_access_p.
(file_access_p, file_metadata_errno, file_attribute_errno)
(file_test_errno, check_file_access, check_emacs_readlinkat):
New functions.
* src/fileio.c (Ffile_executable_p, Ffile_readable_p)
(Ffile_name_case_insensitive_p, Frename_file, Ffile_exists_p):
(Ffile_symlink_p, Ffile_directory_p)
(Ffile_accessible_directory_p, Ffile_regular_p)
(Ffile_selinux_context, Ffile_acl, Ffile_modes)
(Ffile_newer_than_file_p, Fset_visited_file_modtime)
(Ffile_system_info):
* src/filelock.c (unlock_file, Ffile_locked_p):
* src/lread.c (Fload):
Signal serious errors.
* src/fileio.c (Ffile_writable_p): Remove unnecessary CHECK_STRING.
(emacs_readlinkat): Now static.
* src/filelock.c (current_lock_owner, lock_if_free): Return a
positive errno on error, and the negative of the old old value
on success. All callers changed.
* src/lread.c (openp): Propagate serious errno values to caller.
Diffstat (limited to 'src/emacs.c')
| -rw-r--r-- | src/emacs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/emacs.c b/src/emacs.c index 558dd11a351..eb732810db4 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -746,7 +746,7 @@ load_pdump_find_executable (char const *argv0, ptrdiff_t *candidate_size) candidate[path_part_length] = DIRECTORY_SEP; memcpy (candidate + path_part_length + 1, argv0, argv0_length + 1); struct stat st; - if (check_executable (candidate) + if (file_access_p (candidate, X_OK) && stat (candidate, &st) == 0 && S_ISREG (st.st_mode)) return candidate; *candidate = '\0'; |
