diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-04-23 08:20:06 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-04-23 08:20:06 +0000 |
commit | 1b872b3648180aa042e36dd5b3ff38a03fa131e3 (patch) | |
tree | 04f0fba9423fc1a57c5f559ee0a5fc49138ddb6e /tap-rpcprogs.c | |
parent | 81ebec370d30901623ef24b2112e91f8004c6ad0 (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".
svn path=/trunk/; revision=7542
Diffstat (limited to 'tap-rpcprogs.c')
-rw-r--r-- | tap-rpcprogs.c | 11 |
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); } } |