summaryrefslogtreecommitdiff
path: root/storeio/io.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-07-23 17:45:12 +0000
committerMiles Bader <miles@gnu.org>1997-07-23 17:45:12 +0000
commit205d20c9a47f790a505362e47bd88aca4c03feb7 (patch)
tree2af7dcb9a0dcb074de1b3403ee5b14c935dc9b9f /storeio/io.c
parentff5d00776d51e850eac8c2d51f8c960b745f0255 (diff)
(trivfs_S_io_select):
Don't bother returning EBADF. (trivfs_S_io_readable, trivfs_S_io_read, trivfs_S_io_map): Return EBADF instead of EINVAL.
Diffstat (limited to 'storeio/io.c')
-rw-r--r--storeio/io.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/storeio/io.c b/storeio/io.c
index 9c5673c0..45b534c0 100644
--- a/storeio/io.c
+++ b/storeio/io.c
@@ -42,7 +42,7 @@ trivfs_S_io_map (struct trivfs_protid *cred,
if (! cred)
return EOPNOTSUPP;
else if (! (cred->po->openmodes & (O_READ|O_WRITE)))
- return EINVAL;
+ return EBADF;
else
{
mach_port_t memobj;
@@ -87,8 +87,8 @@ trivfs_S_io_read (struct trivfs_protid *cred,
{
if (! cred)
return EOPNOTSUPP;
- else if (!(cred->po->openmodes & O_READ))
- return EINVAL;
+ else if (! (cred->po->openmodes & O_READ))
+ return EBADF;
else
return open_read ((struct open *)cred->po->hook,
offs, amount, (void **)data, data_len);
@@ -105,7 +105,7 @@ trivfs_S_io_readable (struct trivfs_protid *cred,
if (! cred)
return EOPNOTSUPP;
else if (! (cred->po->openmodes & O_READ))
- return EINVAL;
+ return EBADF;
else
{
struct open *open = (struct open *)cred->po->hook;
@@ -129,7 +129,7 @@ trivfs_S_io_write (struct trivfs_protid *cred,
{
if (! cred)
return EOPNOTSUPP;
- else if (!(cred->po->openmodes & O_WRITE))
+ else if (! (cred->po->openmodes & O_WRITE))
return EBADF;
else
return open_write ((struct open *)cred->po->hook,
@@ -158,11 +158,7 @@ trivfs_S_io_select (struct trivfs_protid *cred,
{
if (! cred)
return EOPNOTSUPP;
- else if (((*type & SELECT_READ) && !(cred->po->openmodes & O_READ))
- || ((*type & SELECT_WRITE) && !(cred->po->openmodes & O_WRITE)))
- return EBADF;
- else
- *type &= ~SELECT_URG;
+ *type &= ~SELECT_URG;
return 0;
}