summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2011-11-28 11:20:12 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-11-28 11:20:12 +0100
commita9dae4d97b82b35ba3e03960255b605b260d1208 (patch)
tree19b1acdf898b3e7bd1d8cc2b681863d2f7eb37e4
parent19d7954f3beea3ef8876ddb08a07a3830e446e0a (diff)
Fix select on pfinet tunnel and streamio
* pfinet/tunnel.c (trivfs_S_io_select): Do not return EINVAL on SELECT_URG. * trans/streamio.c (trivfs_S_io_select): Likewise.
-rw-r--r--pfinet/tunnel.c3
-rw-r--r--trans/streamio.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/pfinet/tunnel.c b/pfinet/tunnel.c
index c4f95804..ec96861a 100644
--- a/pfinet/tunnel.c
+++ b/pfinet/tunnel.c
@@ -469,8 +469,7 @@ trivfs_S_io_select (struct trivfs_protid *cred,
tdev = (struct tunnel_device *) cred->po->cntl->hook;
/* We only deal with SELECT_READ here. */
- if (*type & ~SELECT_READ)
- return EINVAL;
+ *type &= SELECT_READ;
if (*type == 0)
return 0;
diff --git a/trans/streamio.c b/trans/streamio.c
index 0faa8a3e..c563c03c 100644
--- a/trans/streamio.c
+++ b/trans/streamio.c
@@ -554,8 +554,7 @@ trivfs_S_io_select (struct trivfs_protid *cred,
if (!(cred->po->openmodes & O_WRITE) && (*type & SELECT_WRITE))
return EBADF;
- if (*type & ~(SELECT_READ | SELECT_WRITE))
- return EINVAL;
+ *type &= SELECT_READ | SELECT_WRITE;
if (*type == 0)
return 0;