summaryrefslogtreecommitdiff
path: root/libstore
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1998-12-26 20:37:11 +0000
committerRoland McGrath <roland@gnu.org>1998-12-26 20:37:11 +0000
commit25efa8f7dbbc2091db525cc8a0c529220429ef74 (patch)
tree539b789fe37fefab182aacd4960654a2410e7e12 /libstore
parentdd7a0376b8fbcd8564b123041d87c9b3c29811f3 (diff)
1998-12-21 Roland McGrath <roland@baalperazim.frob.com>
* 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.
Diffstat (limited to 'libstore')
-rw-r--r--libstore/file.c7
1 files 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 <miles@gnu.ai.mit.edu>
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