diff --git a/src/util.cpp b/src/util.cpp index e589115f8..19ead8fa5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -48,6 +48,8 @@ #include #include #include +#include +#include #include #include @@ -277,7 +279,10 @@ int execute ( int written; const char * input_cstr = input.c_str (); - signal(SIGPIPE, SIG_IGN); // Handled locally with EPIPE. + if (signal (SIGPIPE, SIG_IGN) == SIG_ERR) // Handled locally with EPIPE. + { + throw std::string (std::strerror (errno)); + } if (pipe (pin) == -1) throw std::string (std::strerror (errno));