aboutsummaryrefslogtreecommitdiffstats
path: root/extcap.c
diff options
context:
space:
mode:
authorAnders Esbensen <Anders.Esbensen@silabs.com>2020-01-27 09:58:02 +0100
committerAnders Broman <a.broman58@gmail.com>2020-01-29 15:52:27 +0000
commit8efde3980524daf84405d5778872503ea4f6c9cf (patch)
tree25b5f048d0a780cdcd63b90bf4edf99d0aa38c41 /extcap.c
parente0ca87cfb11de33de44e35e013c7ce26203fdaaa (diff)
extcap: terminate the child process using kill.
On linux and osx extcap would potentially leave the external dumper process running after stopping the capture. With this change the child process will receive a TERM signal when the capture stops. Change-Id: I2681a26509c90696c98c7615fbab172604ce6e31 Reviewed-on: https://code.wireshark.org/review/35959 Reviewed-by: Dario Lombardo <lomato@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'extcap.c')
-rw-r--r--extcap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/extcap.c b/extcap.c
index c44e32c266..7733849678 100644
--- a/extcap.c
+++ b/extcap.c
@@ -1217,6 +1217,10 @@ void extcap_if_cleanup(capture_options *capture_opts, gchar **errormsg)
ws_unlink(interface_opts->extcap_control_out);
interface_opts->extcap_control_out = NULL;
}
+ /* Send termination signal to child. On Linux and OSX the child will not notice that the
+ * pipe has been closed before writing to the pipe.
+ */
+ kill(interface_opts->extcap_pid , SIGTERM);
#endif
/* Maybe the client closed and removed fifo, but ws should check if
* pid should be closed */