diff options
author | fireice-uk <fireice-uk@users.noreply.github.com> | 2017-11-10 19:15:53 +0000 |
---|---|---|
committer | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-11-10 20:15:53 +0100 |
commit | c395800ab527979eec03f184b9a4922229a4b294 (patch) | |
tree | 32e1c5c15f69d038eec300889249242666c6d794 | |
parent | 7942372e218568f8b27446115cfbb743f7cabf6c (diff) | |
download | xmr-stak-c395800ab527979eec03f184b9a4922229a4b294.zip xmr-stak-c395800ab527979eec03f184b9a4922229a4b294.tar.gz |
Disable sigpipe on posix systems (#99)
-rw-r--r-- | xmrstak/misc/executor.cpp | 18 |
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(); |