aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2020-02-28 17:05:27 +0000
committerMark Johnston <markj@FreeBSD.org>2020-02-28 17:05:27 +0000
commitd8f743dcaa8ae633a369e55482eae74833b138fc (patch)
treeb538c1ec1f7dbf38987d19ceff485235dfb3a9d1
parent46994ec2b14d3fedbf712dd2cfb405c47632d920 (diff)
downloadsrc-d8f743dcaa8ae633a369e55482eae74833b138fc.tar.gz
src-d8f743dcaa8ae633a369e55482eae74833b138fc.zip
Do not load dtraceall.ko if dtrace.ko is already loaded.
This was the intent of the existing code, but instead it would unconditionally load dtraceall.ko because of a stale errno value. Reported by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=358435
-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