summaryrefslogtreecommitdiff
path: root/libtrivfs
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-11-08 21:50:23 +0000
committerRoland McGrath <roland@gnu.org>1999-11-08 21:50:23 +0000
commita08789e5b2cdf4fb2227d5986eaaf46c6d7f923a (patch)
tree5ff3ef110472a93fe9292a8a1fda5c884b179fe9 /libtrivfs
parent0169b627239a4222d2af960f9e1985c278782707 (diff)
1999-11-08 Roland McGrath <roland@baalperazim.frob.com>
* io-write.c (trivfs_S_io_write): Return EBADF if trivfs_allow_open doesn't include O_WRITE.
Diffstat (limited to 'libtrivfs')
-rw-r--r--libtrivfs/io-write.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libtrivfs/io-write.c b/libtrivfs/io-write.c
index 05b57fde..5501f270 100644
--- a/libtrivfs/io-write.c
+++ b/libtrivfs/io-write.c
@@ -1,5 +1,5 @@
-/*
- Copyright (C) 1994 Free Software Foundation
+/*
+ Copyright (C) 1994, 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -28,6 +28,9 @@ trivfs_S_io_write (struct trivfs_protid *cred,
off_t off,
mach_msg_type_number_t *amt)
{
+ if (!(trivfs_allow_open & O_WRITE))
+ return EBADF;
+
assert (!trivfs_support_write);
return EOPNOTSUPP;
}