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/6528de6f0376
branches:  trunk
changeset: 984322:6528de6f0376
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 2bacb5877310 -r 6528de6f0376 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 @@
        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