diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-12-25 02:33:29 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-12-25 02:36:03 -0800 |
commit | 42d58264db165d265cba68d6dbebc53a50738355 (patch) | |
tree | 87543f2f0992a6b57a34dbd6ee04f48c3f6e7486 /lib/euidaccess.c | |
parent | 5880c7caab394eac55c44d4be42b2f45dbd9bc53 (diff) | |
download | emacs-42d58264db165d265cba68d6dbebc53a50738355.tar.gz |
Update Gnulib.
All changes in this commit are autogenerated by running
admin/merge-gnulib.
Diffstat (limited to 'lib/euidaccess.c')
-rw-r--r-- | lib/euidaccess.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/euidaccess.c b/lib/euidaccess.c index b352123ae18..a32e3366eb8 100644 --- a/lib/euidaccess.c +++ b/lib/euidaccess.c @@ -107,7 +107,10 @@ euidaccess (const char *file, int mode) safe. */ if (mode == F_OK) - return stat (file, &stats); + { + int result = stat (file, &stats); + return result != 0 && errno == EOVERFLOW ? 0 : result; + } else { int result; @@ -142,8 +145,8 @@ euidaccess (const char *file, int mode) /* If we are not set-uid or set-gid, access does the same. */ return access (file, mode); - if (stat (file, &stats) != 0) - return -1; + if (stat (file, &stats) == -1) + return mode == F_OK && errno == EOVERFLOW ? 0 : -1; /* The super-user can read and write any file, and execute any file that anyone can execute. */ |