summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2006-01-06 16:30:30 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2006-01-06 16:30:30 +0000
commit38f63f7e47372686ec51506514ac2278884d3b9c (patch)
treef88c5a59f00b165788ee9ff213f675c12c81b87a /sys/kern
parent8dc0e020233f42230cd91f94111c8fd8ed70b629 (diff)
Notes
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_descrip.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 28922d3ad57e..7cc2c12508e1 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1983,8 +1983,7 @@ _fget(struct thread *td, int fd, struct file **fpp, int flags, int hold)
}
/*
- * Note: FREAD failure returns EBADF to maintain backwards
- * compatibility with what routines returned before.
+ * FREAD and FWRITE failure return EBADF as per POSIX.
*
* Only one flag, or 0, may be specified.
*/
@@ -1994,7 +1993,7 @@ _fget(struct thread *td, int fd, struct file **fpp, int flags, int hold)
}
if (flags == FWRITE && (fp->f_flag & FWRITE) == 0) {
FILEDESC_UNLOCK(fdp);
- return (EINVAL);
+ return (EBADF);
}
if (hold) {
fhold(fp);