From a08789e5b2cdf4fb2227d5986eaaf46c6d7f923a Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 8 Nov 1999 21:50:23 +0000 Subject: 1999-11-08 Roland McGrath * io-write.c (trivfs_S_io_write): Return EBADF if trivfs_allow_open doesn't include O_WRITE. --- libtrivfs/io-write.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libtrivfs/io-write.c') 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; } -- cgit v1.2.3