]> git.eshelyaron.com Git - emacs.git/commit
Improve reporting of I/O, access errors
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 18 Sep 2019 02:18:14 +0000 (19:18 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 18 Sep 2019 02:24:38 +0000 (19:24 -0700)
commit9dc306b1db08196684d05a474148e16305adbad0
tree78a401e0156a34ef1d2ae99acad31fb3ad9cb806
parentae3edf0ac3f1e893338917497b55859d6aca7d42
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.
doc/lispref/files.texi
etc/NEWS
src/dired.c
src/emacs.c
src/fileio.c
src/filelock.c
src/lisp.h
src/lread.c