From c8022d1e701a4663840003f165f5a804d837524e Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 21 Aug 2017 17:05:41 +0300 Subject: Disable displaying error reporting dialog box on Windows unless run serially --- build2/b.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build2/b.cxx b/build2/b.cxx index ef8b97b..1510b39 100644 --- a/build2/b.cxx +++ b/build2/b.cxx @@ -4,6 +4,8 @@ #ifndef _WIN32 # include // signal() +#else +# include #endif #include // getenv() _putenv()(_WIN32) @@ -102,10 +104,18 @@ main (int argc, char* argv[]) // 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 for the current + // and child processes unless we run serially. This way we avoid multiple + // dialog boxes to potentially pop up. + // #ifndef _WIN32 if (signal (SIGPIPE, SIG_IGN) == SIG_ERR) fail << "unable to ignore broken pipe (SIGPIPE) signal: " << system_error (errno, generic_category ()); // Sanitize. +#else + if (!ops.serial_stop ()) + SetErrorMode (SetErrorMode (0) | // Returns the current mode. + SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); #endif // Parse the command line. We want to be able to specify options, vars, -- cgit v1.1