mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-02-19 23:02:19 +01:00
18 lines
786 B
Diff
18 lines
786 B
Diff
See https://gitlab.alpinelinux.org/alpine/aports/-/issues/13573
|
|
|
|
diff -upr mqtt-exec-0.4.orig/mqtt-exec.c mqtt-exec-0.4/mqtt-exec.c
|
|
--- mqtt-exec-0.4.orig/mqtt-exec.c 2022-03-03 20:21:34.603698460 +0100
|
|
+++ mqtt-exec-0.4/mqtt-exec.c 2022-03-03 20:22:00.017134230 +0100
|
|
@@ -29,6 +29,11 @@ void message_cb(struct mosquitto *mosq,
|
|
struct userdata *ud = (struct userdata *)obj;
|
|
if (msg->payloadlen || ud->verbose) {
|
|
if (ud->command_argv && fork() == 0) {
|
|
+ /* mosquitto ignores SIGPIPE, this is a problem as it
|
|
+ * gets inherited by all processes spawned by mqtt-exec
|
|
+ * restore the default handler explicitly for now. */
|
|
+ signal(SIGPIPE, SIG_DFL);
|
|
+
|
|
if (ud->verbose)
|
|
ud->command_argv[ud->command_argc-2] = msg->topic;
|
|
ud->command_argv[ud->command_argc-1] =
|