diff options
author | Miles Bader <miles@gnu.org> | 1997-07-22 21:26:55 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1997-07-22 21:26:55 +0000 |
commit | f311d711c30f7845baf3f86a7f3727fa96b1e711 (patch) | |
tree | c99d8c4e2c90cdd626b9344dcc653276fada4210 /storeio | |
parent | efe21a1f6b951341c4204c5cfc52ae2989ff5770 (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.c | 4 |
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); |