Commit fcc8b0cb fcc8b0cbf626c629cb85fa83fbad61d25380c378 by Sam Roberts

Return EINVAL for meaningless combination of MU_STREAM_READ + WRITE.

1 parent 7481f59a
2001-06-03 Sam Roberts
* mailbox/file_stream.c,mailbox/mapfile_stream.c: Return EINVAL
for meaningless combination of MU_STREAM_READ + WRITE.
2001-06-03 Alain Magloire
* doc/*; Bunch of typos corrected.
......
......@@ -244,7 +244,9 @@ _file_open (stream_t stream, const char *filename, int port, int flags)
}
/* Map the flags to the system equivalent. */
if (flags & MU_STREAM_WRITE)
if (flags & MU_STREAM_WRITE && flags & MU_STREAM_READ)
return EINVAL;
else if (flags & MU_STREAM_WRITE)
flg = O_WRONLY;
else if (flags & MU_STREAM_RDWR)
flg = O_RDWR;
......
......@@ -279,7 +279,9 @@ _mapfile_open (stream_t stream, const char *filename, int port, int flags)
mfs->fd = -1;
}
/* Map the flags to the system equivalent */
if (flags & MU_STREAM_WRITE)
if (flags & MU_STREAM_WRITE && flags & MU_STREAM_READ)
return EINVAL;
else if (flags & MU_STREAM_WRITE)
{
mflag = PROT_WRITE;
flg = O_WRONLY;
......