# HG changeset patch # User Richard M. Stallman # Date 780880843 0 # Node ID c17b2a49b6ec2bfff29699dfdb4b9379bcc23b27 # Parent 8cf9181c119eb6eb4cea01251ddba9ab510bf090 (check_writable, check_executable) [__HURD__]: Use eaccess. diff -r 8cf9181c119e -r c17b2a49b6ec src/fileio.c --- a/src/fileio.c Thu Sep 29 23:12:31 1994 +0000 +++ b/src/fileio.c Thu Sep 29 23:20:43 1994 +0000 @@ -2177,19 +2177,7 @@ 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 @@ 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.