summaryrefslogtreecommitdiff
path: root/dumpcap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-05-17 18:40:23 +0000
committerGuy Harris <guy@alum.mit.edu>2010-05-17 18:40:23 +0000
commit991c5e9898d057f6b7d2f41397f460931ef5ff83 (patch)
tree95c2cc5755ba14006af226237a6f07eebd5f7e2c /dumpcap.c
parent01c752e5efd10bdc5ca280d5e03dd19be466d9cb (diff)
downloadwireshark-991c5e9898d057f6b7d2f41397f460931ef5ff83.tar.gz
When dumpcap is run to get an interface list, interface capabilities, or
interface statistics, have its error messages come out as sync-pipe errors, have it send a sync-pipe "success" message on success, and have the callers get that message and display it. svn path=/trunk/; revision=32843
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/dumpcap.c b/dumpcap.c
index ef865b97e7..0a6f5fff10 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -682,6 +682,9 @@ print_machine_readable_interfaces(GList *if_list)
if_addr_t *if_addr;
char addr_str[ADDRSTRLEN];
+ /* Let our parent know we succeeded. */
+ pipe_write_block(2, SP_SUCCESS, NULL);
+
i = 1; /* Interface id number */
for (if_entry = g_list_first(if_list); if_entry != NULL;
if_entry = g_list_next(if_entry)) {
@@ -747,6 +750,9 @@ print_machine_readable_if_capabilities(if_capabilities_t *caps)
data_link_info_t *data_link_info;
const gchar *desc_str;
+ /* Let our parent know we succeeded. */
+ pipe_write_block(2, SP_SUCCESS, NULL);
+
if (caps->can_set_rfmon)
printf("1\n");
else
@@ -817,6 +823,9 @@ print_statistics_loop(gboolean machine_readable)
return 2;
}
+ /* Let our parent know we succeeded. */
+ pipe_write_block(2, SP_SUCCESS, NULL);
+
if (!machine_readable) {
printf("%-15s %10s %10s\n", "Interface", "Received",
"Dropped");
@@ -3478,9 +3487,9 @@ main(int argc, char *argv[])
caps = get_if_capabilities(global_capture_opts.iface,
global_capture_opts.monitor_mode, &err_str);
if (caps == NULL) {
- cmdarg_err("The capabilities of the capture device \"%s\" could not be obtained (%s)."
+ cmdarg_err("The capabilities of the capture device \"%s\" could not be obtained (%s).\n"
"Please check to make sure you have sufficient permissions, and that\n"
- "you have the proper interface or pipe specified.\n", global_capture_opts.iface, err_str);
+ "you have the proper interface or pipe specified.", global_capture_opts.iface, err_str);
g_free(err_str);
exit_main(2);
}