From 1e0d117eb7ab1ce7f4ff8a4fd6dc2529634d7baa Mon Sep 17 00:00:00 2001 From: David Perry Date: Wed, 9 Feb 2022 14:32:28 +0000 Subject: Specify directory for temporary captures --- extcap.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'extcap.c') diff --git a/extcap.c b/extcap.c index 46f6aa392e..2e2a964958 100644 --- a/extcap.c +++ b/extcap.c @@ -1547,13 +1547,13 @@ static gboolean extcap_create_pipe(const gchar *ifname, gchar **fifo, HANDLE *ha return TRUE; } #else -static gboolean extcap_create_pipe(const gchar *ifname, gchar **fifo, const gchar *pipe_prefix) +static gboolean extcap_create_pipe(const gchar *ifname, gchar **fifo, const gchar *temp_dir, const gchar *pipe_prefix) { gchar *temp_name = NULL; int fd = 0; gchar *pfx = g_strconcat(pipe_prefix, "_", ifname, NULL); - if ((fd = create_tempfile(&temp_name, pfx, NULL, NULL)) < 0) + if ((fd = create_tempfile(temp_dir, &temp_name, pfx, NULL, NULL)) < 0) { g_free(pfx); return FALSE; @@ -1611,11 +1611,15 @@ extcap_init_interfaces(capture_options *capture_opts) extcap_create_pipe(interface_opts->name, &interface_opts->extcap_control_in, #ifdef _WIN32 &interface_opts->extcap_control_in_h, +#else + capture_opts->temp_dir, #endif EXTCAP_CONTROL_IN_PREFIX); extcap_create_pipe(interface_opts->name, &interface_opts->extcap_control_out, #ifdef _WIN32 &interface_opts->extcap_control_out_h, +#else + capture_opts->temp_dir, #endif EXTCAP_CONTROL_OUT_PREFIX); } @@ -1624,6 +1628,8 @@ extcap_init_interfaces(capture_options *capture_opts) if (!extcap_create_pipe(interface_opts->name, &interface_opts->extcap_fifo, #ifdef _WIN32 &interface_opts->extcap_pipe_h, +#else + capture_opts->temp_dir, #endif EXTCAP_PIPE_PREFIX)) { -- cgit v1.2.3