From 1f777eecff0ddd254758579f87426c3dfb200d1c Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 23 May 1999 22:25:21 +0000 Subject: 1999-05-23 Roland McGrath * storeio.c (check_open_hook): Translate D_NO_SUCH_DEVICE to ENXIO. --- storeio/storeio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'storeio') 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; } -- cgit v1.2.3