summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/syscall
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/syscall')
-rw-r--r--usr/src/uts/common/syscall/open.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr/src/uts/common/syscall/open.c b/usr/src/uts/common/syscall/open.c
index 874e31869c..94dc02b284 100644
--- a/usr/src/uts/common/syscall/open.c
+++ b/usr/src/uts/common/syscall/open.c
@@ -24,10 +24,11 @@
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
+ * Copyright 2021 OmniOS Community Edition (OmniOSce) Association.
*/
/*
* Portions of this source code were derived from Berkeley 4.3 BSD
@@ -116,11 +117,11 @@ copen(int startfd, char *fname, int filemode, int createmode)
if (filemode & FXATTRDIROPEN) {
if (auditing && startvp != NULL)
audit_setfsat_path(1);
- if (error = lookupnameat(fname, seg, FOLLOW,
- NULLVPP, &vp, startvp))
- return (set_errno(error));
+ error = lookupnameat(fname, seg, FOLLOW, NULLVPP, &vp, startvp);
if (startvp != NULL)
VN_RELE(startvp);
+ if (error != 0)
+ return (set_errno(error));
startvp = vp;
}