diff options
author | Guy Harris <guy@alum.mit.edu> | 2006-03-01 01:46:52 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2006-03-01 01:46:52 +0000 |
commit | 8ac0325b2b6ccac39ee1304b31fd4128b9b2d748 (patch) | |
tree | 169dfe62b85d7c57bd84475eab55f6b0c7de8626 /capture.c | |
parent | aed93fa46a3e16ac8c48aa562be70eec4b5ff81d (diff) |
Clean up indentation a bit.
In "capture_input_new_file()", don't call the callbacks unless we
succeed in opening the new file. Have "capture_info_new_file()" return
a success/failure indication.
Improve the message logged when we fail to open the new file if we're
only opening it for the quick packet counts. We really should put up an
alert box and give up on the capture at that point.
svn path=/trunk/; revision=17437
Diffstat (limited to 'capture.c')
-rw-r--r-- | capture.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -279,7 +279,7 @@ capture_input_new_file(capture_options *capture_opts, gchar *new_file) /* if we are in real-time mode, open the new file now */ if(capture_opts->real_time_mode) { /* Attempt to open the capture file and set up to read from it. */ - switch(cf_start_tail(capture_opts->cf, capture_opts->save_file, is_tempfile, &err)) { + switch(cf_start_tail(capture_opts->cf, capture_opts->save_file, is_tempfile, &err)) { case CF_OK: break; case CF_ERROR: @@ -290,15 +290,18 @@ capture_input_new_file(capture_options *capture_opts, gchar *new_file) return FALSE; break; } + } + + if(capture_opts->show_info) { + if (!capture_info_new_file(new_file)) + return FALSE; + } + if(capture_opts->real_time_mode) { cf_callback_invoke(cf_cb_live_capture_update_started, capture_opts); } else { cf_callback_invoke(cf_cb_live_capture_fixed_started, capture_opts); } - - if(capture_opts->show_info) - capture_info_new_file(new_file); - capture_opts->state = CAPTURE_RUNNING; return TRUE; |