Merged revisions 275182 via svnmerge from
authorMatthew Nicholson <mnicholson@digium.com>
Fri, 9 Jul 2010 18:24:03 +0000 (18:24 +0000)
committerMatthew Nicholson <mnicholson@digium.com>
Fri, 9 Jul 2010 18:24:03 +0000 (18:24 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r275182 | mnicholson | 2010-07-09 13:23:23 -0500 (Fri, 09 Jul 2010) | 2 lines

  give a better error message when attempting to unload a module that is not loaded
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275186 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/loader.c

index 69a5a8c..8a3d18b 100644 (file)
@@ -494,8 +494,10 @@ int ast_unload_resource(const char *resource_name, enum ast_module_unload_mode f
                return -1;
        }
 
-       if (!mod->flags.running || mod->flags.declined)
+       if (!mod->flags.running || mod->flags.declined) {
+               ast_log(LOG_WARNING, "Unload failed, '%s' is not loaded.\n", resource_name);
                error = 1;
+       }
 
        if (!error && (mod->usecount > 0)) {
                if (force)