]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Be more forgiving about loaded modules
authorAlan T. DeKok <aland@freeradius.org>
Thu, 22 Nov 2012 14:20:20 +0000 (09:20 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 22 Nov 2012 14:21:52 +0000 (09:21 -0500)
If they don't exist, don't complain

src/modules/rlm_perl/rlm_perl.c

index 8fad3b85b7524063a341b5c4611532b8fbd9072c..ce956cb066034c508a5b180196a9f0859bb17d01 100644 (file)
@@ -154,12 +154,7 @@ static void **rlm_perl_get_handles(pTHX)
        AV *modules = get_av(dl_modules, FALSE);
        void **handles;
 
-       if (!librefs) {
-               radlog(L_ERR,
-                  "Could not get @%s for unloading.\n",
-                  dl_librefs);
-               return NULL;
-       }
+       if (!librefs) return NULL;
 
        if (!(AvFILL(librefs) >= 0)) {
                return NULL;
@@ -241,8 +236,8 @@ static void rlm_destroy_perl(PerlInterpreter *perl)
        PERL_SET_CONTEXT(perl);
 
        handles = rlm_perl_get_handles(aTHX);
+       if (handles) rlm_perl_close_handles(handles);
        rlm_perl_destruct(perl);
-       rlm_perl_close_handles(handles);
 }
 
 /* Create Key */
@@ -494,6 +489,8 @@ static int perl_instantiate(CONF_SECTION *conf, void **instance)
        PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
 #endif
 
+        newXS("radiusd::radlog",XS_radiusd_radlog, "rlm_perl");
+
        exitstatus = perl_parse(inst->perl, xs_init, argc, embed, NULL);
 
        end_AV = PL_endav;
@@ -510,8 +507,6 @@ static int perl_instantiate(CONF_SECTION *conf, void **instance)
 
        PL_endav = end_AV;
 
-        newXS("radiusd::radlog",XS_radiusd_radlog, "rlm_perl.c");
-
        rad_reply_hv = newHV();
        rad_check_hv = newHV();
        rad_config_hv = newHV();