diff options
author | Bill Meier <wmeier@newsguy.com> | 2014-08-20 20:11:49 -0400 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2014-08-21 23:58:15 +0000 |
commit | 0c38cf3c7bdd21da0f08a0d46bfa5afc98d70f40 (patch) | |
tree | 6db0bdf187d8ca137d553bd168d0a7b634f7feed | |
parent | f580ebe3a97f834a744af9681c4e5b97903cc0a3 (diff) | |
download | wireshark-0c38cf3c7bdd21da0f08a0d46bfa5afc98d70f40.tar.gz |
plugins.c: cleanup plugins_scan_dir()
add_plugin() no longer returns ENOMEM. Remove code in
plugins_scan_dir() which printed an error message
if ENOMEM returned by add_plugin().
Fix comment re add_plugin() return values.
Change-Id: Id5170c28e2a55884d41ceebc4e07f16389b75a2a
Reviewed-on: https://code.wireshark.org/review/3774
Reviewed-by: Bill Meier <wmeier@newsguy.com>
-rw-r--r-- | wsutil/plugins.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/wsutil/plugins.c b/wsutil/plugins.c index 703a5a8f46..aea9f811c4 100644 --- a/wsutil/plugins.c +++ b/wsutil/plugins.c @@ -106,7 +106,6 @@ add_plugin_type(const char *type, plugin_callback callback) * add a new plugin to the list * returns : * - 0 : OK - * - ENOMEM : memory allocation problem * - EEXIST : the same plugin (i.e. name/version) was already registered. */ static int @@ -230,16 +229,13 @@ plugins_scan_dir(const char *dirname) /* * OK, attempt to add it to the list of plugins. */ - if ((cr = add_plugin(new_plug))) + cr = add_plugin(new_plug); + if (cr != 0) { - if (cr == EEXIST) - fprintf(stderr, "The plugin %s, version %s\n" - "was found in multiple directories\n", - new_plug->name, new_plug->version); - else - fprintf(stderr, "Memory allocation problem\n" - "when processing plugin %s, version %s\n", - new_plug->name, new_plug->version); + g_assert(cr == EEXIST); + fprintf(stderr, "The plugin %s, version %s\n" + "was found in multiple directories\n", + new_plug->name, new_plug->version); g_module_close(handle); g_free(new_plug->name); g_free(new_plug); |