aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-07-25 13:10:49 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-07-25 13:11:21 +0300
commit9658fa80fd81f17508ff8b3413fe9e9ded0b83e6 (patch)
treeb51bc25689e691dc8d24f956c291d9fd102cb964
parent7b14b3d83274157eff8886cb36d277087f72d223 (diff)
Disable displaying error reporting dialog box on Windows for bbot worker
-rw-r--r--bbot/worker/worker.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx
index 2107dc3..3c74800 100644
--- a/bbot/worker/worker.cxx
+++ b/bbot/worker/worker.cxx
@@ -5,6 +5,8 @@
#ifndef _WIN32
# include <signal.h> // signal()
#else
+# include <libbutl/win32-utility.hxx>
+
# include <stdlib.h> // getenv(), _putenv()
#endif
@@ -756,10 +758,16 @@ try
// terminates a process. Also note that there is no way to disable this
// behavior on a file descriptor basis or for the write() function call.
//
+ // On Windows disable displaying error reporting dialog box. Note that the
+ // error mode is inherited by child processes.
+ //
#ifndef _WIN32
if (signal (SIGPIPE, SIG_IGN) == SIG_ERR)
fail << "unable to ignore broken pipe (SIGPIPE) signal: "
<< system_error (errno, generic_category ()); // Sanitize.
+#else
+ SetErrorMode (SetErrorMode (0) | // Returns the current mode.
+ SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
#endif
cli::argv_scanner scan (argc, argv, true);