aboutsummaryrefslogtreecommitdiffstats
path: root/src/lread.c
diff options
context:
space:
mode:
authorStephen Leake2019-09-18 17:43:28 -0700
committerStephen Leake2019-09-18 17:43:28 -0700
commit34f1035e878a06ad181ff7fc533cd1fa0a565847 (patch)
tree7708b0e62b09571ba5b2c625d810cd932c380508 /src/lread.c
parentb478444099655f36f7b243e21e8f98051299ca8f (diff)
parent107ce3050fc37b9a13d8304ae1bb73fac9de5f61 (diff)
downloademacs-34f1035e878a06ad181ff7fc533cd1fa0a565847.tar.gz
emacs-34f1035e878a06ad181ff7fc533cd1fa0a565847.zip
Merge commit '107ce3050fc37b9a13d8304ae1bb73fac9de5f61'
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/lread.c b/src/lread.c
index 6ae7a0d8ba0..99e0ce30ba6 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1343,18 +1343,26 @@ Return t if the file exists and loads successfully. */)
1343 /* openp already checked for newness, no point doing it again. 1343 /* openp already checked for newness, no point doing it again.
1344 FIXME would be nice to get a message when openp 1344 FIXME would be nice to get a message when openp
1345 ignores suffix order due to load_prefer_newer. */ 1345 ignores suffix order due to load_prefer_newer. */
1346 Lisp_Object notfound = found;
1346 if (!load_prefer_newer && is_elc) 1347 if (!load_prefer_newer && is_elc)
1347 { 1348 {
1348 result = stat (SSDATA (efound), &s1); 1349 result = stat (SSDATA (efound), &s1);
1350 int err = errno;
1349 if (result == 0) 1351 if (result == 0)
1350 { 1352 {
1351 SSET (efound, SBYTES (efound) - 1, 0); 1353 SSET (efound, SBYTES (efound) - 1, 0);
1352 result = stat (SSDATA (efound), &s2); 1354 result = stat (SSDATA (efound), &s2);
1355 err = errno;
1353 SSET (efound, SBYTES (efound) - 1, 'c'); 1356 SSET (efound, SBYTES (efound) - 1, 'c');
1357 if (result != 0)
1358 notfound = Fsubstring (found, make_fixnum (0),
1359 make_fixnum (-1));
1354 } 1360 }
1355 1361 if (result != 0)
1356 if (result == 0 1362 file_test_errno (notfound, err);
1357 && timespec_cmp (get_stat_mtime (&s1), get_stat_mtime (&s2)) < 0) 1363 else if (timespec_cmp (get_stat_mtime (&s1),
1364 get_stat_mtime (&s2))
1365 < 0)
1358 { 1366 {
1359 /* Make the progress messages mention that source is newer. */ 1367 /* Make the progress messages mention that source is newer. */
1360 newer = 1; 1368 newer = 1;
@@ -1748,16 +1756,20 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes,
1748 { 1756 {
1749 if (file_directory_p (encoded_fn)) 1757 if (file_directory_p (encoded_fn))
1750 last_errno = EISDIR; 1758 last_errno = EISDIR;
1751 else 1759 else if (errno == ENOENT || errno == ENOTDIR)
1752 fd = 1; 1760 fd = 1;
1761 else
1762 last_errno = errno;
1753 } 1763 }
1764 else if (! (errno == ENOENT || errno == ENOTDIR))
1765 last_errno = errno;
1754 } 1766 }
1755 else 1767 else
1756 { 1768 {
1757 fd = emacs_open (pfn, O_RDONLY, 0); 1769 fd = emacs_open (pfn, O_RDONLY, 0);
1758 if (fd < 0) 1770 if (fd < 0)
1759 { 1771 {
1760 if (errno != ENOENT) 1772 if (! (errno == ENOENT || errno == ENOTDIR))
1761 last_errno = errno; 1773 last_errno = errno;
1762 } 1774 }
1763 else 1775 else