From d5648b511c9ac364de13abea65a5201c5121c35f Mon Sep 17 00:00:00 2001 From: Wilhelm Schuermann Date: Fri, 3 Oct 2014 16:49:38 +0200 Subject: [PATCH] Util - Added includes to make FreeBSD happy. - Added more error handling. --- src/util.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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));