summaryrefslogtreecommitdiff
path: root/gnu/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2006-11-30 19:20:42 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2006-11-30 19:20:42 +0000
commit1992792221c8da7cf7aa08b9ec984b1a533d6e65 (patch)
tree2870563175576e046840afe1660c4628896f3ddd /gnu/usr.bin
parented9c7b8269bd4cef9dd23fe20947ad6d1ebad6e7 (diff)
When using setproctitle() don't fall back into the non-setproctitle()
code. Fixes an environment corruption problem when $0 is modified. From Alexander Bluhm; this is perl bug #41008
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r--gnu/usr.bin/perl/mg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gnu/usr.bin/perl/mg.c b/gnu/usr.bin/perl/mg.c
index 95f11b3603f..7686f73e4ef 100644
--- a/gnu/usr.bin/perl/mg.c
+++ b/gnu/usr.bin/perl/mg.c
@@ -2509,15 +2509,14 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
setproctitle("%s", s);
# endif
}
-#endif
-#if defined(__hpux) && defined(PSTAT_SETCMD)
+#elif defined(__hpux) && defined(PSTAT_SETCMD)
{
union pstun un;
s = SvPV_const(sv, len);
un.pst_command = (char *)s;
pstat(PSTAT_SETCMD, un, len, 0, 0);
}
-#endif
+#else
/* PL_origalen is set in perl_parse(). */
s = SvPV_force(sv,len);
if (len >= (STRLEN)PL_origalen) {
@@ -2539,6 +2538,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
for (i = 1; i < PL_origargc; i++)
PL_origargv[i] = 0;
}
+#endif
UNLOCK_DOLLARZERO_MUTEX;
break;
#endif