aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 8a64a20510..19cf9f3818 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -5447,9 +5447,20 @@ main(int argc, char *argv[])
caps = get_if_capabilities(interface_opts, &err, &err_str);
if (caps == NULL) {
- cmdarg_err("The capabilities of the capture device \"%s\" could not be obtained (%s).\n"
- "%s", interface_opts->name, err_str,
- get_pcap_failure_secondary_error_message(err, err_str));
+ if (capture_child) {
+ char *error_msg = g_strdup_printf("The capabilities of the capture device"
+ " \"%s\" could not be obtained (%s)",
+ interface_opts->name, err_str);
+ sync_pipe_errmsg_to_parent(2, error_msg,
+ get_pcap_failure_secondary_error_message(err, err_str));
+ g_free(error_msg);
+ }
+ else {
+ cmdarg_err("The capabilities of the capture device"
+ "\"%s\" could not be obtained (%s).\n%s",
+ interface_opts->name, err_str,
+ get_pcap_failure_secondary_error_message(err, err_str));
+ }
g_free(err_str);
exit_main(2);
}