"Primary Error: %s", error_msg);
g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG,
"Secondary Error: %s", secondary_error_msg);
- sync_pipe_errmsg_to_parent(error_msg, secondary_error_msg);
+ sync_pipe_errmsg_to_parent(1, error_msg, secondary_error_msg);
} else {
fprintf(stderr, "%s\n%s\n", error_msg, secondary_error_msg);
}
/* sync_pipe.h
- * Low-level synchronization pipe routines for use by Wireshark and dumpcap
+ * Low-level synchronization pipe routines for use by Wireshark/TShark
+ * and dumpcap
*
* $Id$
*
/** the child encountered an error, notify the parent */
extern void
-sync_pipe_errmsg_to_parent(const char *error_msg,
+sync_pipe_errmsg_to_parent(int pipe, const char *error_msg,
const char *secondary_error_msg);
#endif /* sync_pipe.h */
void
-sync_pipe_errmsg_to_parent(const char *error_msg, const char *secondary_error_msg)
+sync_pipe_errmsg_to_parent(int pipe, const char *error_msg,
+ const char *secondary_error_msg)
{
/* first write a "master header" with the length of the two messages plus their "slave headers" */
- pipe_write_header(1, SP_ERROR_MSG, strlen(error_msg) + 1 + 4 + strlen(secondary_error_msg) + 1 + 4);
- pipe_write_block(1, SP_ERROR_MSG, error_msg);
- pipe_write_block(1, SP_ERROR_MSG, secondary_error_msg);
+ pipe_write_header(pipe, SP_ERROR_MSG, strlen(error_msg) + 1 + 4 + strlen(secondary_error_msg) + 1 + 4);
+ pipe_write_block(pipe, SP_ERROR_MSG, error_msg);
+ pipe_write_block(pipe, SP_ERROR_MSG, secondary_error_msg);
}