diff options
author | pfg <pfg@FreeBSD.org> | 2013-04-17 02:20:17 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2013-04-17 02:20:17 +0000 |
commit | f9796e10e2b7bb43bf358c337b15bb183a6b1aaf (patch) | |
tree | daa5db7d59bdba8c6f4ebf57f4923612b4fd09b6 /cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c | |
parent | 3ab51705b73c481b6bc76e733f494db7fa6f31fd (diff) | |
download | FreeBSD-src-f9796e10e2b7bb43bf358c337b15bb183a6b1aaf.zip FreeBSD-src-f9796e10e2b7bb43bf358c337b15bb183a6b1aaf.tar.gz |
DTrace: Revert r249367
The following change from illumos brought caused DTrace to
pause in an interactive environment:
3026 libdtrace should set LD_NOLAZYLOAD=1 to help the pid provider
This was not detected during testing because it doesn't
affect scripts.
We shouldn't be changing the environment, especially since the
LD_NOLAZYLOAD option doesn't apply to our (GNU) ld.
Unfortunately the change from upstream was made in such a way
that it is very difficult to separate this change from the
others so, at least for now, it's better to just revert
everything.
Reference:
https://www.illumos.org/issues/3026
Reported by: Navdeep Parhar and Mark Johnston
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c | 63 |
1 files changed, 1 insertions, 62 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c index 020df2f..fa1407f 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_options.c @@ -26,10 +26,6 @@ #pragma ident "%Z%%M% %I% %E% SMI" -/* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ - #include <sys/resource.h> #include <sys/mman.h> #include <sys/types.h> @@ -372,61 +368,6 @@ dt_opt_pgmax(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) return (0); } -static int -dt_opt_setenv(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) -{ - char **p; - char *var; - int i; - - /* - * We can't effectively set environment variables from #pragma lines - * since the processes have already been spawned. - */ - if (dtp->dt_pcb != NULL) - return (dt_set_errno(dtp, EDT_BADOPTCTX)); - - if (arg == NULL) - return (dt_set_errno(dtp, EDT_BADOPTVAL)); - - if (!option && strchr(arg, '=') != NULL) - return (dt_set_errno(dtp, EDT_BADOPTVAL)); - - for (i = 1, p = dtp->dt_proc_env; *p != NULL; i++, p++) - continue; - - for (p = dtp->dt_proc_env; *p != NULL; p++) { - var = strchr(*p, '='); - if (var == NULL) - var = *p + strlen(*p); - if (strncmp(*p, arg, var - *p) == 0) { - dt_free(dtp, *p); - *p = dtp->dt_proc_env[i - 1]; - dtp->dt_proc_env[i - 1] = NULL; - i--; - } - } - - if (option) { - if ((var = strdup(arg)) == NULL) - return (dt_set_errno(dtp, EDT_NOMEM)); - - if ((p = dt_alloc(dtp, sizeof (char *) * (i + 1))) == NULL) { - dt_free(dtp, var); - return (dt_set_errno(dtp, EDT_NOMEM)); - } - - bcopy(dtp->dt_proc_env, p, sizeof (char *) * i); - dt_free(dtp, dtp->dt_proc_env); - dtp->dt_proc_env = p; - - dtp->dt_proc_env[i - 1] = var; - dtp->dt_proc_env[i] = NULL; - } - - return (0); -} - /*ARGSUSED*/ static int dt_opt_stdc(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) @@ -470,6 +411,7 @@ dt_opt_syslibdir(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) return (0); } + /*ARGSUSED*/ static int dt_opt_tree(dtrace_hdl_t *dtp, const char *arg, uintptr_t option) @@ -970,7 +912,6 @@ static const dt_option_t _dtrace_ctoptions[] = { { "pgmax", dt_opt_pgmax }, { "preallocate", dt_opt_preallocate }, { "pspec", dt_opt_cflags, DTRACE_C_PSPEC }, - { "setenv", dt_opt_setenv, 1 }, { "stdc", dt_opt_stdc }, { "strip", dt_opt_dflags, DTRACE_D_STRIP }, { "syslibdir", dt_opt_syslibdir }, @@ -979,7 +920,6 @@ static const dt_option_t _dtrace_ctoptions[] = { { "udefs", dt_opt_invcflags, DTRACE_C_UNODEF }, { "undef", dt_opt_cpp_opts, (uintptr_t)"-U" }, { "unodefs", dt_opt_cflags, DTRACE_C_UNODEF }, - { "unsetenv", dt_opt_setenv, 0 }, { "verbose", dt_opt_cflags, DTRACE_C_DIFV }, { "version", dt_opt_version }, { "zdefs", dt_opt_cflags, DTRACE_C_ZDEFS }, @@ -1007,7 +947,6 @@ static const dt_option_t _dtrace_rtoptions[] = { { "statusrate", dt_opt_rate, DTRACEOPT_STATUSRATE }, { "strsize", dt_opt_strsize, DTRACEOPT_STRSIZE }, { "ustackframes", dt_opt_runtime, DTRACEOPT_USTACKFRAMES }, - { "temporal", dt_opt_runtime, DTRACEOPT_TEMPORAL }, { NULL, NULL, 0 } }; |