+2008-08-31 Bruno Haible <bruno@clisp.org>
+
+ * msgexec.c: Include <signal.h>.
+ (main): Block SIGPIPE for the duration of the processing.
+
2008-08-23 Bruno Haible <bruno@clisp.org>
Fix behaviour of "msgmerge --update" when sorting is requested and
#include <getopt.h>
#include <limits.h>
#include <locale.h>
+#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
if (strcmp (sub_name, "0") != 0)
{
+ /* Block SIGPIPE for this process and for the subprocesses.
+ The subprogram may have side effects (additionally to producing some
+ output), therefore if there are no readers on stdout, processing of the
+ strings must continue nevertheless. */
+ {
+ sigset_t sigpipe_set;
+
+ sigemptyset (&sigpipe_set);
+ sigaddset (&sigpipe_set, SIGPIPE);
+ sigprocmask (SIG_UNBLOCK, &sigpipe_set, NULL);
+ }
+
/* Attempt to locate the program.
This is an optimization, to avoid that spawn/exec searches the PATH
on every call. */