OS/390 cleanable gunk.
[p5sagit/p5-mst-13.2.git] / perl.c
diff --git a/perl.c b/perl.c
index 13c7d31..8b3066e 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -273,12 +273,6 @@ perl_construct(pTHXx)
     New(31337, PL_reentrant_buffer->tmbuff,1, struct tm);
 #endif
 
-#ifdef DEBUGGING
-    sv_setpvn(PERL_DEBUG_PAD(0), "", 0);
-    sv_setpvn(PERL_DEBUG_PAD(1), "", 0);
-    sv_setpvn(PERL_DEBUG_PAD(2), "", 0);
-#endif
-
     /* Note that strtab is a rather special HV.  Assumptions are made
        about not iterating on it, and not adding tie magic to it.
        It is properly deallocated in perl_destruct() */
@@ -3421,7 +3415,7 @@ Perl_init_argv_symbols(pTHX_ register int argc, register char **argv)
 
 #ifdef HAS_PROCSELFEXE
 /* This is a function so that we don't hold on to MAXPATHLEN
-   bytes of stack longer than necessary.
+   bytes of stack longer than necessary
  */
 STATIC void
 S_procself_val(pTHX_ SV *sv, char *arg0)
@@ -3437,35 +3431,6 @@ S_procself_val(pTHX_ SV *sv, char *arg0)
 }
 #endif /* HAS_PROCSELFEXE */
 
-#if defined(sun) && defined(__svr4__) /* solaris */
-#include <sys/auxv.h>
-STATIC void
-S_procselfauxv(pTHX_ SV *sv, char *arg0) {
-    auxv_t auxv;
-    int fh;
-    int n;
-
-    fh = open("/proc/self/auxv", O_RDONLY);
-    if (fh < 0) {
-        sv_setpv(sv, arg0);
-        return;
-    }
-
-    while (1) {
-        n = read(fh, &auxv, sizeof(auxv));
-        if (n != sizeof(auxv))
-            break;
-        if (auxv.a_type == AT_SUN_EXECNAME) {
-            close(fh);
-            sv_setpv(sv, auxv.a_un.a_ptr);
-           return;
-        }
-    }
-    close(fh);
-    sv_setpv(sv, arg0);
-}
-#endif /* solaris */
-
 STATIC void
 S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register char **env)
 {
@@ -3502,15 +3467,11 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register
 #ifdef HAS_PROCSELFEXE
        S_procself_val(aTHX_ GvSV(tmpgv), PL_origargv[0]);
 #else
-#   ifdef OS2
+#ifdef OS2
        sv_setpv(GvSV(tmpgv), os2_execname(aTHX));
-#   else
-#       if defined(sun) && defined(__svr4__) /* solaris */
-       S_procselfauxv(aTHX_ GvSV(tmpgv), PL_origargv[0]);
-#       else
-       sv_setpv(GvSV(tmpgv), PL_origargv[0]);
-#       endif
-#   endif
+#else
+       sv_setpv(GvSV(tmpgv),PL_origargv[0]);
+#endif
 #endif
     }
     if ((PL_envgv = gv_fetchpv("ENV",TRUE, SVt_PVHV))) {
@@ -3571,8 +3532,11 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register
 #endif /* USE_ENVIRON_ARRAY */
     }
     TAINT_NOT;
-    if ((tmpgv = gv_fetchpv("$",TRUE, SVt_PV)))
+    if ((tmpgv = gv_fetchpv("$",TRUE, SVt_PV))) {
+        SvREADONLY_off(GvSV(tmpgv));
        sv_setiv(GvSV(tmpgv), (IV)PerlProc_getpid());
+        SvREADONLY_on(GvSV(tmpgv));
+    }
 }
 
 STATIC void