diff options
author | Roland McGrath <roland@gnu.org> | 1999-05-23 22:25:21 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1999-05-23 22:25:21 +0000 |
commit | 1f777eecff0ddd254758579f87426c3dfb200d1c (patch) | |
tree | 6743812467ac9b2a96ff961cc29764c7a61ffb0a /storeio/storeio.c | |
parent | 9fe088efe6d899a5ccc2e666b70e2319c166501a (diff) |
1999-05-23 Roland McGrath <roland@baalperazim.frob.com>
* storeio.c (check_open_hook): Translate D_NO_SUCH_DEVICE to ENXIO.
Diffstat (limited to 'storeio/storeio.c')
-rw-r--r-- | storeio/storeio.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/storeio/storeio.c b/storeio/storeio.c index afd654bb..0224aa11 100644 --- a/storeio/storeio.c +++ b/storeio/storeio.c @@ -190,6 +190,10 @@ check_open_hook (struct trivfs_control *trivfs_control, /* If we're not opening for read or write, then just ignore the error, as this allows stat to word correctly. XXX */ err = 0; + if (err == D_NO_SUCH_DEVICE) + /* Give the canonical POSIX error code for an absent device, + rather than letting the Mach code propagate up. */ + err = ENXIO; } mutex_unlock (&device_lock); @@ -243,7 +247,7 @@ trivfs_modify_stat (struct trivfs_protid *cred, struct stat *st) st->st_size = size; st->st_blocks = size / 512; - + st->st_mode |= ((inhibit_cache || store->block_size == 1) ? S_IFCHR : S_IFBLK); } @@ -253,7 +257,7 @@ trivfs_modify_stat (struct trivfs_protid *cred, struct stat *st) st->st_blksize = 0; st->st_size = 0; st->st_blocks = 0; - + st->st_mode |= inhibit_cache ? S_IFCHR : S_IFBLK; } |