From 8b45db89d6cf631a435e91ed7c755cf90aa2a825 Mon Sep 17 00:00:00 2001 From: "sgjesse@chromium.org" Date: Wed, 19 Nov 2008 10:09:21 +0000 Subject: [PATCH] Changed the handling of Win32 function SetErrorMode to be more correct. The flag to prevent error dialogs is now merged with existing flags, and the error mode is now reset which it was not before. Review URL: http://codereview.chromium.org/11471 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@792 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- tools/test.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/test.py b/tools/test.py index e193e27..5cff304 100755 --- a/tools/test.py +++ b/tools/test.py @@ -417,8 +417,12 @@ def RunProcess(context, timeout, args, **rest): if utils.IsWindows(): popen_args = '"' + subprocess.list2cmdline(args) + '"' if context.suppress_dialogs: - # Try to change the error mode to avoid dialogs on fatal errors. - Win32SetErrorMode(SEM_NOGPFAULTERRORBOX) + # Try to change the error mode to avoid dialogs on fatal errors. Don't + # touch any existing error mode flags by merging the existing error mode. + # See http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx. + error_mode = SEM_NOGPFAULTERRORBOX; + prev_error_mode = Win32SetErrorMode(error_mode); + Win32SetErrorMode(error_mode | prev_error_mode); process = subprocess.Popen( shell = utils.IsWindows(), args = popen_args, -- 2.7.4