aboutsummaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1994-09-29 23:20:43 +0000
committerRichard M. Stallman <[email protected]>1994-09-29 23:20:43 +0000
commitb2728f4bdef6c98089669447fcc4b04d133b1ef7 (patch)
treec8dba9f8ef08b52018ab6845d5fc9f3a9c5fbf6c /src/fileio.c
parentc820123b60386cc62e238d76f6a4cb1e93d0e059 (diff)
(check_writable, check_executable) [__HURD__]: Use eaccess.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/src/fileio.c b/src/fileio.c
index a06032a3ca..42290b8eca 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2177,19 +2177,7 @@ check_executable (filename)
char *filename;
{
#ifdef __HURD__
- mach_port_t file;
- int access_mode;
-
- file = path_lookup (filename, 0, 0);
- if (file == MACH_PORT_NULL)
- /* File can't be opened. */
- access_mode = 0;
- else
- {
- file_access (file, &access_mode);
- mach_port_deallocate (mach_task_self (), file);
- }
- return !!(access_mode & O_EXEC);
+ return (eaccess (filename, 1) >= 0);
#else
/* Access isn't quite right because it uses the real uid
and we really want to test with the effective uid.
@@ -2205,19 +2193,7 @@ check_writable (filename)
char *filename;
{
#ifdef __HURD__
- mach_port_t file;
- int access_mode;
-
- file = path_lookup (filename, 0, 0);
- if (file == MACH_PORT_NULL)
- /* File can't be opened. */
- access_mode = 0;
- else
- {
- file_access (file, &access_mode);
- mach_port_deallocate (mach_task_self (), file);
- }
- return !!(access_mode & O_WRITE);
+ return (eaccess (filename, 2) >= 0);
#else
/* Access isn't quite right because it uses the real uid
and we really want to test with the effective uid.