From 25efa8f7dbbc2091db525cc8a0c529220429ef74 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 26 Dec 1998 20:37:11 +0000 Subject: 1998-12-21 Roland McGrath * open.c (store_open): Like file.c:fiopen, catch EACCES or EROFS and try to open read-only. * file.c (fiopen): Treat EROFS same as EACCES. --- libstore/file.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libstore/file.c b/libstore/file.c index ae09f958..e952a91e 100644 --- a/libstore/file.c +++ b/libstore/file.c @@ -1,6 +1,6 @@ /* File store backend - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 96, 97, 98 Free Software Foundation, Inc. Written by Miles Bader This file is part of the GNU Hurd. @@ -66,7 +66,8 @@ fiopen (const char *name, file_t *file, int *mod_flags) else { *file = file_name_lookup (name, O_RDWR, 0); - if (*file == MACH_PORT_NULL && errno == EACCES) + if (*file == MACH_PORT_NULL + && (errno == EACCES || errno == EROFS)) { *file = file_name_lookup (name, O_RDONLY, 0); if (*file != MACH_PORT_NULL) @@ -96,7 +97,7 @@ enforced (struct store *store) else /* See if the the current (one) range is that the kernel is enforcing. */ { - struct stat st; + struct stat st; error_t err = io_stat (store->port, &st); if (!err -- cgit v1.2.3