diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2005-06-02 05:05:29 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2005-06-02 05:05:29 +0000 |
commit | ab2edb9e3307a172487bb16edcaf79600bf9ebea (patch) | |
tree | 891357990f461f806713fa4cb52c1b9bb91d1ba3 /lib/euidaccess.c | |
parent | 1e6b9bd047bdaf17291f87e44a218814dd6560f5 (diff) | |
download | coreutils-ab2edb9e3307a172487bb16edcaf79600bf9ebea.tar.xz |
Don't use "path" or "filename" to mean "file name"
in comments or local variable names.
Diffstat (limited to 'lib/euidaccess.c')
-rw-r--r-- | lib/euidaccess.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/euidaccess.c b/lib/euidaccess.c index 2b36fc64a..4bb93aa0b 100644 --- a/lib/euidaccess.c +++ b/lib/euidaccess.c @@ -77,21 +77,21 @@ #endif -/* Return 0 if the user has permission of type MODE on file PATH; +/* Return 0 if the user has permission of type MODE on FILE; otherwise, return -1 and set `errno'. Like access, except that it uses the effective user and group id's instead of the real ones, and it does not always check for read-only file system, text busy, etc. */ int -euidaccess (const char *path, int mode) +euidaccess (const char *file, int mode) { #if defined EFF_ONLY_OK - return access (path, mode | EFF_ONLY_OK); + return access (file, mode | EFF_ONLY_OK); #elif defined ACC_SELF - return accessx (path, mode, ACC_SELF); + return accessx (file, mode, ACC_SELF); #elif HAVE_EACCESS - return eaccess (path, mode); + return eaccess (file, mode); #else uid_t uid = getuid (); @@ -110,7 +110,7 @@ euidaccess (const char *path, int mode) safe. */ if (mode == F_OK) - return stat (path, &stats); + return stat (file, &stats); else { int result; @@ -121,7 +121,7 @@ euidaccess (const char *path, int mode) if (gid != egid) setregid (egid, gid); - result = access (path, mode); + result = access (file, mode); saved_errno = errno; /* Restore them. */ @@ -143,9 +143,9 @@ euidaccess (const char *path, int mode) unsigned int granted; if (uid == euid && gid == egid) /* If we are not set-uid or set-gid, access does the same. */ - return access (path, mode); + return access (file, mode); - if (stat (path, &stats)) + if (stat (file, &stats) != 0) return -1; /* The super-user can read and write any file, and execute any file |