|
@@ -46,6 +46,7 @@ static clish_shell_hooks_t my_hooks = {
|
|
|
NULL /* don't register any builtin functions */
|
|
|
};
|
|
|
|
|
|
+static void sighandler(int signo);
|
|
|
static void help(int status, const char *argv0);
|
|
|
|
|
|
/*--------------------------------------------------------- */
|
|
@@ -112,7 +113,7 @@ int main(int argc, char **argv)
|
|
|
sigaddset(&sigpipe_set, SIGPIPE);
|
|
|
sigpipe_act.sa_flags = 0;
|
|
|
sigpipe_act.sa_mask = sigpipe_set;
|
|
|
- sigpipe_act.sa_handler = SIG_IGN;
|
|
|
+ sigpipe_act.sa_handler = &sighandler;
|
|
|
sigaction(SIGPIPE, &sigpipe_act, NULL);
|
|
|
|
|
|
#if HAVE_LOCALE_H
|
|
@@ -375,3 +376,14 @@ static void help(int status, const char *argv0)
|
|
|
printf("\t-z <num>, --histsize=<num>\tCommand history size in lines.\n");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+/*--------------------------------------------------------- */
|
|
|
+/*
|
|
|
+ * Signal handler for SIGPIPE.
|
|
|
+ * It's empty but it's needed to don't ignore SIGPIPE because
|
|
|
+ * SIG_IGN will be inherited while ACTION execution.
|
|
|
+ */
|
|
|
+static void sighandler(int signo)
|
|
|
+{
|
|
|
+ return;
|
|
|
+}
|