Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Return error from fd_dupopen.



details:   https://anonhg.NetBSD.org/src/rev/0687880641ca
branches:  trunk
changeset: 380044:0687880641ca
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Jul 03 09:39:26 2021 +0000

description:
Return error from fd_dupopen.

diffstat:

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

diffs (32 lines):

diff -r 03004604f239 -r 0687880641ca sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c   Sat Jul 03 04:44:16 2021 +0000
+++ b/sys/kern/vfs_syscalls.c   Sat Jul 03 09:39:26 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_syscalls.c,v 1.550 2021/06/29 22:40:53 dholland Exp $      */
+/*     $NetBSD: vfs_syscalls.c,v 1.551 2021/07/03 09:39:26 mlelstv Exp $       */
 
 /*-
  * Copyright (c) 2008, 2009, 2019, 2020 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.550 2021/06/29 22:40:53 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.551 2021/07/03 09:39:26 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -1674,10 +1674,9 @@ do_open(lwp_t *l, struct vnode *dvp, str
        if (vp == NULL) {
                fd_abort(p, fp, indx);
                error = fd_dupopen(dupfd, dupfd_move, flags, &indx);
-               if (error == 0) {
-                       *fd = indx;
-                       return 0;
-               }
+               if (error)
+                       return error;
+               *fd = indx;
        } else {
                error = open_setfp(l, fp, vp, indx, flags);
                if (error)



Home | Main Index | Thread Index | Old Index