http://bugs.ethereal.com/bugzilla/show_bug.cgi?id=377
[obnox/wireshark/wip.git] / tap-stats_tree.c
index 5c40acd367a2dce9541ea72bbdaa5fe3f8f44486..c7996fd80d9f968a7d5f39d009c1fe603e2c0e14 100644 (file)
@@ -32,6 +32,7 @@
 #include <glib.h>
 #include <epan/stats_tree_priv.h>
 #include <epan/stat_cmd_args.h>
+#include <epan/report_err.h>
 
 /* actually unused */
 struct _st_node_pres {
@@ -84,13 +85,15 @@ static void  init_stats_tree(const char *optarg) {
                                st->filter=NULL;
                        }
                } else {
-                       g_error("no such stats_tree (%s) found in stats_tree registry",abbr);
+                       report_failure("no such stats_tree (%s) found in stats_tree registry",abbr);
+                       return;
                }
                
                g_free(abbr);
                
        } else {
-               g_error("could not obtain stats_tree abbr (%s) from optarg '%s'",abbr,optarg);          
+               report_failure("could not obtain stats_tree abbr (%s) from optarg '%s'",abbr,optarg);           
+               return;
        }
        
        error_string = register_tap_listener( st->cfg->tapname,
@@ -101,7 +104,8 @@ static void  init_stats_tree(const char *optarg) {
                                                                                  draw_stats_tree);
        
        if (error_string) {
-               g_error("stats_tree for: %s failed to attach to the tap: %s",cfg->name,error_string->str);
+               report_failure("stats_tree for: %s failed to attach to the tap: %s",cfg->name,error_string->str);
+               return;
        }
 
        if (cfg->init) cfg->init(st);