aboutsummaryrefslogtreecommitdiffstats
path: root/tap-rpcprogs.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-04-23 08:20:06 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2003-04-23 08:20:06 +0000
commitba91fe1919e92b5e7202e10d8ab53dbd783eaecf (patch)
tree04f0fba9423fc1a57c5f559ee0a5fc49138ddb6e /tap-rpcprogs.c
parentd7d2a95b9a62c2055b4906a51a0c824d9c9d3f93 (diff)
Make "register_tap_listener()" return NULL on success and a "GString *"
referring to a GString containing an error message on failure, and don't have it print anything on failure. If it fails, have its Tethereal-tap callers print an error message before exiting, and have its Ethereal callers pop up a dialog box with the error (except in cases where the failure is guaranteed not to be the user's fault, and where we exit, in which case we just print an error message before we exit). In all cases, the error message includes the text of the GString. Fix a scanf format string in the DCE RPC statistics Ethereal tap, so that it properly skips the comma before the filter string. Fix some Ethereal error messages not to say "tethereal". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7542 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'tap-rpcprogs.c')
-rw-r--r--tap-rpcprogs.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tap-rpcprogs.c b/tap-rpcprogs.c
index d544234388..7b6155a6fc 100644
--- a/tap-rpcprogs.c
+++ b/tap-rpcprogs.c
@@ -1,7 +1,7 @@
/* tap-rpcprogs.c
* rpcstat 2002 Ronnie Sahlberg
*
- * $Id: tap-rpcprogs.c,v 1.4 2003/04/23 03:50:59 guy Exp $
+ * $Id: tap-rpcprogs.c,v 1.5 2003/04/23 08:20:02 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -222,13 +222,18 @@ rpcprogs_draw(void *dummy _U_)
static void
rpcprogs_init(char *optarg _U_)
{
+ GString *error_string;
+
if(already_enabled){
return;
}
already_enabled=1;
- if(register_tap_listener("rpc", NULL, NULL, NULL, rpcprogs_packet, rpcprogs_draw)){
- fprintf(stderr,"tethereal: rpcprogs_init() failed to attach to tap.\n");
+ error_string=register_tap_listener("rpc", NULL, NULL, NULL, rpcprogs_packet, rpcprogs_draw);
+ if(error_string){
+ fprintf(stderr,"tethereal: Couldn't register rpc,programs tap: %s\n",
+ error_string->str);
+ g_string_free(error_string, TRUE);
exit(1);
}
}