Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern fd_open(): fix confusion between userland and kerne...



details:   https://anonhg.NetBSD.org/src/rev/2819b83e0d6c
branches:  trunk
changeset: 773661:2819b83e0d6c
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Feb 12 13:12:45 2012 +0000

description:
fd_open(): fix confusion between userland and kernel encoding of open flags

diffstat:

 sys/kern/vfs_syscalls.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r f7a7fe150807 -r 2819b83e0d6c sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c   Sun Feb 12 12:43:51 2012 +0000
+++ b/sys/kern/vfs_syscalls.c   Sun Feb 12 13:12:45 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_syscalls.c,v 1.448 2012/02/11 23:16:17 martin Exp $        */
+/*     $NetBSD: vfs_syscalls.c,v 1.449 2012/02/12 13:12:45 martin Exp $        */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.448 2012/02/11 23:16:17 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.449 2012/02/12 13:12:45 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -1525,8 +1525,10 @@
 fd_open(const char *path, int open_flags, int open_mode, int *fd)
 {
        struct pathbuf *pb;
-
-       if ((open_flags & (FREAD | FWRITE)) == 0)
+       int oflags;
+
+       oflags = FFLAGS(open_flags);
+       if ((oflags & (FREAD | FWRITE)) == 0)
                return EINVAL;
 
        pb = pathbuf_create(path);



Home | Main Index | Thread Index | Old Index