Re: AIX and gcc (moving targets)
[p5sagit/p5-mst-13.2.git] / ext / DynaLoader / dlutils.c
index 9423085..9d88f5f 100644 (file)
@@ -21,7 +21,7 @@ static HV *dl_loaded_files = Nullhv;  /* only needed on a few systems */
 
 
 #ifdef DEBUGGING
-static int dl_debug = 0;       /* value copied from $DynaLoader::dl_error */
+static int dl_debug = 0;       /* value copied from $DynaLoader::dl_debug */
 #define DLDEBUG(level,code)    if (dl_debug>=level) { code; }
 #else
 #define DLDEBUG(level,code)
@@ -45,7 +45,7 @@ dl_unload_all_files(pTHXo_ void *unused)
            PUSHMARK(SP);
            XPUSHs(sv_2mortal(dl_libref));
            PUTBACK;
-           call_sv((SV*)sub, G_DISCARD);
+           call_sv((SV*)sub, G_DISCARD | G_NODEBUG);
            FREETMPS;
            LEAVE;
         }
@@ -69,7 +69,9 @@ dl_generic_private_init(pTHXo)        /* called by dl_*.xs dl_private_init() */
     if (!dl_loaded_files)
        dl_loaded_files = newHV(); /* provide cache for dl_*.xs if needed */
 #endif
+#ifdef DL_UNLOAD_ALL_AT_EXIT
     call_atexit(&dl_unload_all_files, (void*)0);
+#endif
 }