aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'cddl/contrib')
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
index 492fb937cba2..482da920b754 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
@@ -1105,7 +1105,7 @@ dt_vopen(int version, int flags, int *errp,
dt_provmod_open(&provmod, &df);
dtfd = open("/dev/dtrace/dtrace", O_RDWR | O_CLOEXEC);
- err = errno; /* save errno from opening dtfd */
+ err = dtfd == -1 ? errno : 0; /* save errno from opening dtfd */
#if defined(__FreeBSD__)
/*
* Automatically load the 'dtraceall' module if we couldn't open the