summaryrefslogtreecommitdiff
path: root/storeio
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-07-22 21:26:55 +0000
committerMiles Bader <miles@gnu.org>1997-07-22 21:26:55 +0000
commitf311d711c30f7845baf3f86a7f3727fa96b1e711 (patch)
treec99d8c4e2c90cdd626b9344dcc653276fada4210 /storeio
parentefe21a1f6b951341c4204c5cfc52ae2989ff5770 (diff)
(trivfs_S_io_read):
Return EINVAL instead of EBADF. (trivfs_S_io_map): Return EINVAL if CRED cannot be read or written.
Diffstat (limited to 'storeio')
-rw-r--r--storeio/io.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/storeio/io.c b/storeio/io.c
index 4586c683..9c5673c0 100644
--- a/storeio/io.c
+++ b/storeio/io.c
@@ -41,6 +41,8 @@ trivfs_S_io_map (struct trivfs_protid *cred,
{
if (! cred)
return EOPNOTSUPP;
+ else if (! (cred->po->openmodes & (O_READ|O_WRITE)))
+ return EINVAL;
else
{
mach_port_t memobj;
@@ -86,7 +88,7 @@ trivfs_S_io_read (struct trivfs_protid *cred,
if (! cred)
return EOPNOTSUPP;
else if (!(cred->po->openmodes & O_READ))
- return EBADF;
+ return EINVAL;
else
return open_read ((struct open *)cred->po->hook,
offs, amount, (void **)data, data_len);