$0 modifying part II (HP-UX only)
Jarkko Hietaniemi [Sat, 30 Nov 2002 20:16:51 +0000 (22:16 +0200)]
Subject: [PATCH] $0 modifying
Message-ID: <20021130181651.GA5876@kosh.hut.fi>

p4raw-id: //depot/perl@18230

mg.c

diff --git a/mg.c b/mg.c
index 69bb521..ea15875 100644 (file)
--- a/mg.c
+++ b/mg.c
 #  endif
 #endif
 
+#ifdef __hpux
+#  include <sys/pstat.h>
+#endif
+
 /* if you only have signal() and it resets on each signal, FAKE_PERSISTENT_SIGNAL_HANDLERS fixes */
 #if !defined(HAS_SIGACTION) && defined(VMS)
 #  define  FAKE_PERSISTENT_SIGNAL_HANDLERS
@@ -2232,6 +2236,14 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
 #   endif
        }
 #endif
+#if defined(__hpux) && defined(PSTAT_SETCMD)
+       {
+            union pstun un;
+            s = SvPV(sv, len);
+            un.pst_command = s;
+            pstat(PSTAT_SETCMD, un, len, 0, 0);
+       }
+#endif
        if (!PL_origalen) {
            s = PL_origargv[0];
            s += strlen(s);