diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 1999-08-19 05:31:38 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 1999-08-19 05:31:38 +0000 |
commit | 11632e26a2e959d51a5bba79698a8699ef0d2750 (patch) | |
tree | 9ea3f0562b63feb029a13b9d17f856181e5ceecb /capture.c | |
parent | a00e3c6e22e13a4235971139dd784c28d1802992 (diff) |
Have the per-capture-file-type open routines "wtap_open_offline()" calls
return 1 on success, -1 if they got an error, and 0 if the file isn't of
the type that file is checking for, and supply an error code if they
return -1; have "wtap_open_offline()" use that error code. Also, have
the per-capture-file-type open routines treat errors accessing the file
as errors, and return -1, rather than just returning 0 so that we try
another file type.
Have the per-capture-file-type read routines "wtap_loop()" calls return
-1 and supply an error code on error (and not, as they did in some
cases, call "g_error()" and abort), and have "wtap_loop()", if the read
routine returned an error, return FALSE (and pass an error-code-pointer
argument onto the read routines, so they fill it in), and return TRUE on
success.
Add some new error codes for them to return.
Now that "wtap_loop()" can return a success/failure indication and an
error code, in "read_cap_file()" put up a message box if we get an error
reading the file, and return the error code.
Handle the additional errors we can get when opening a capture file.
If the attempt to open a capture file succeeds, but the attempt to read
it fails, don't treat that as a complete failure - we may have managed
to read some of the capture file, and we should display what we managed
to read.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@516 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture.c')
-rw-r--r-- | capture.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1,7 +1,7 @@ /* capture.c * Routines for packet capture windows * - * $Id: capture.c,v 1.55 1999/08/18 17:08:39 guy Exp $ + * $Id: capture.c,v 1.56 1999/08/19 05:31:21 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -702,10 +702,9 @@ fail: if ((err = open_cap_file(cf.save_file, &cf)) == 0) { /* Set the read filter to NULL. */ cf.rfcode = NULL; - if ((err = read_cap_file(&cf)) == 0) { - set_menu_sensitivity("/File/Save", TRUE); - set_menu_sensitivity("/File/Save As...", FALSE); - } + err = read_cap_file(&cf); + set_menu_sensitivity("/File/Save", TRUE); + set_menu_sensitivity("/File/Save As...", FALSE); } } } |