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
This commit is contained in:
sgjesse@chromium.org 2008-11-19 10:09:21 +00:00
parent d54583f140
commit 8b45db89d6

View File

@ -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,