summaryrefslogtreecommitdiffstats
path: root/xmrstak
diff options
context:
space:
mode:
authorfireice-uk <fireice-uk@users.noreply.github.com>2017-11-10 19:15:53 +0000
committerpsychocrypt <psychocrypt@users.noreply.github.com>2017-11-10 20:15:53 +0100
commitc395800ab527979eec03f184b9a4922229a4b294 (patch)
tree32e1c5c15f69d038eec300889249242666c6d794 /xmrstak
parent7942372e218568f8b27446115cfbb743f7cabf6c (diff)
downloadxmr-stak-c395800ab527979eec03f184b9a4922229a4b294.zip
xmr-stak-c395800ab527979eec03f184b9a4922229a4b294.tar.gz
Disable sigpipe on posix systems (#99)
Diffstat (limited to 'xmrstak')
-rw-r--r--xmrstak/misc/executor.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/xmrstak/misc/executor.cpp b/xmrstak/misc/executor.cpp
index 931e2aa..6f48edd 100644
--- a/xmrstak/misc/executor.cpp
+++ b/xmrstak/misc/executor.cpp
@@ -449,8 +449,26 @@ void executor::on_miner_result(size_t pool_id, job_result& oResult)
}
}
+#ifndef _WIN32
+
+#include <signal.h>
+void disable_sigpipe()
+{
+ struct sigaction sa;
+ sa.sa_handler = SIG_IGN;
+ sa.sa_flags = 0;
+ if (sigaction(SIGPIPE, &sa, 0) == -1)
+ printer::inst()->print_msg(L1, "ERROR: Call to sigaction failed!");
+}
+
+#else
+inline void disable_sigpipe() {}
+#endif
+
void executor::ex_main()
{
+ disable_sigpipe();
+
assert(1000 % iTickTime == 0);
xmrstak::miner_work oWork = xmrstak::miner_work();
OpenPOWER on IntegriCloud