diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h @@ -331,6 +331,7 @@ int dt_stdout_fd; /* file descriptor for saved stdout */ #else FILE *dt_freopen_fp; /* file pointer for freopened stdout */ + char bootfile[MAXPATHLEN]; /* kernel boot file */ #endif dtrace_handle_err_f *dt_errhdlr; /* error handler, if any */ void *dt_errarg; /* error handler argument */ diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c @@ -1311,19 +1311,18 @@ */ #ifndef illumos { - char bootfile[MAXPATHLEN]; char *p; int i; - size_t len = sizeof(bootfile); + size_t len = sizeof(dtp->bootfile); /* This call shouldn't fail, but use a default just in case. */ - if (sysctlbyname("kern.bootfile", bootfile, &len, NULL, 0) != 0) - strlcpy(bootfile, "kernel", sizeof(bootfile)); + if (sysctlbyname("kern.bootfile", dtp->bootfile, &len, NULL, 0) != 0) + strlcpy(dtp->bootfile, "/boot/kernel/kernel", sizeof(dtp->bootfile)); - if ((p = strrchr(bootfile, '/')) != NULL) + if ((p = strrchr(dtp->bootfile, '/')) != NULL) p++; else - p = bootfile; + p = dtp->bootfile; /* * Format the global variables based on the kernel module name.