diff options
| author | Paul Eggert | 2019-09-18 05:17:03 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-09-18 05:18:58 -0700 |
| commit | 9597ee68d999d43145d47ff53e1474f1493f8727 (patch) | |
| tree | 3b93b2c431a6aaaf1695841894f64f4e172943c9 | |
| parent | 98586c2fe62fd26bc9105a06b78d93446bd2a269 (diff) | |
| download | emacs-9597ee68d999d43145d47ff53e1474f1493f8727.tar.gz emacs-9597ee68d999d43145d47ff53e1474f1493f8727.zip | |
Out-of-datedness .elc check is merely a file test
* src/fileio.c (file_test_errno): Now extern.
* src/lread.c (Fload): Use file_test_errno instead,
since this is really just a file test (the attributes
are not given to the user).
| -rw-r--r-- | etc/NEWS | 2 | ||||
| -rw-r--r-- | src/fileio.c | 2 | ||||
| -rw-r--r-- | src/lisp.h | 1 | ||||
| -rw-r--r-- | src/lread.c | 2 |
4 files changed, 4 insertions, 3 deletions
| @@ -2009,7 +2009,7 @@ longer defaults to 'buffer-file-name'. | |||
| 2009 | ** File metadata primitives now signal an error if I/O, access, or | 2009 | ** File metadata primitives now signal an error if I/O, access, or |
| 2010 | other serious errors prevent them from determining the result. | 2010 | other serious errors prevent them from determining the result. |
| 2011 | Formerly, these functions often (though not always) returned nil. | 2011 | Formerly, these functions often (though not always) returned nil. |
| 2012 | For example, if the directory /etc/firewalld is not searchable, | 2012 | For example, if searching /etc/firewalld results in an I/O error, |
| 2013 | (file-symlink-p "/etc/firewalld/firewalld.conf") now signals an error | 2013 | (file-symlink-p "/etc/firewalld/firewalld.conf") now signals an error |
| 2014 | instead of returning nil, because file-symlink-p cannot determine | 2014 | instead of returning nil, because file-symlink-p cannot determine |
| 2015 | whether a symbolic link exists there. These functions still behave as | 2015 | whether a symbolic link exists there. These functions still behave as |
diff --git a/src/fileio.c b/src/fileio.c index 53eecc31aaf..5337ea5c800 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -265,7 +265,7 @@ file_attribute_errno (Lisp_Object file, int err) | |||
| 265 | enum { PICKY_EACCES = false }; | 265 | enum { PICKY_EACCES = false }; |
| 266 | #endif | 266 | #endif |
| 267 | 267 | ||
| 268 | static Lisp_Object | 268 | Lisp_Object |
| 269 | file_test_errno (Lisp_Object file, int err) | 269 | file_test_errno (Lisp_Object file, int err) |
| 270 | { | 270 | { |
| 271 | if (!PICKY_EACCES && err == EACCES) | 271 | if (!PICKY_EACCES && err == EACCES) |
diff --git a/src/lisp.h b/src/lisp.h index e68d2732e21..b081ae1cee8 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -4315,6 +4315,7 @@ extern AVOID report_file_errno (const char *, Lisp_Object, int); | |||
| 4315 | extern AVOID report_file_error (const char *, Lisp_Object); | 4315 | extern AVOID report_file_error (const char *, Lisp_Object); |
| 4316 | extern AVOID report_file_notify_error (const char *, Lisp_Object); | 4316 | extern AVOID report_file_notify_error (const char *, Lisp_Object); |
| 4317 | extern Lisp_Object file_attribute_errno (Lisp_Object, int); | 4317 | extern Lisp_Object file_attribute_errno (Lisp_Object, int); |
| 4318 | extern Lisp_Object file_test_errno (Lisp_Object, int); | ||
| 4318 | extern bool internal_delete_file (Lisp_Object); | 4319 | extern bool internal_delete_file (Lisp_Object); |
| 4319 | extern Lisp_Object check_emacs_readlinkat (int, Lisp_Object, char const *); | 4320 | extern Lisp_Object check_emacs_readlinkat (int, Lisp_Object, char const *); |
| 4320 | extern bool file_directory_p (Lisp_Object); | 4321 | extern bool file_directory_p (Lisp_Object); |
diff --git a/src/lread.c b/src/lread.c index d8883db46c1..ab0fab47a98 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -1358,7 +1358,7 @@ Return t if the file exists and loads successfully. */) | |||
| 1358 | make_fixnum (-1)); | 1358 | make_fixnum (-1)); |
| 1359 | } | 1359 | } |
| 1360 | if (result != 0) | 1360 | if (result != 0) |
| 1361 | file_attribute_errno (found, err); | 1361 | file_test_errno (found, err); |
| 1362 | else if (timespec_cmp (get_stat_mtime (&s1), | 1362 | else if (timespec_cmp (get_stat_mtime (&s1), |
| 1363 | get_stat_mtime (&s2)) | 1363 | get_stat_mtime (&s2)) |
| 1364 | < 0) | 1364 | < 0) |