diff options
author | Trent Nelson <trent.nelson@snakebite.org> | 2008-04-03 20:00:08 (GMT) |
---|---|---|
committer | Trent Nelson <trent.nelson@snakebite.org> | 2008-04-03 20:00:08 (GMT) |
commit | 2aae1d92ebf442b08efce2bc5d090d70fb92e525 (patch) | |
tree | a1cf1f67410d44b2d9dedd90f37f80ab57dc2a7c /PCbuild | |
parent | 8d69c1f95f680debc1f65c209fb4ce6a41cc923f (diff) | |
download | cpython-2aae1d92ebf442b08efce2bc5d090d70fb92e525.zip cpython-2aae1d92ebf442b08efce2bc5d090d70fb92e525.tar.gz cpython-2aae1d92ebf442b08efce2bc5d090d70fb92e525.tar.bz2 |
Make kill_python a little more forgiving if it can't obtain a snapshot of module information for a given python[_d].exe process. Failing here was too pessimistic; the python[_d].exe process may be owned by another user, which is the case in some buildbot environments.
Diffstat (limited to 'PCbuild')
-rw-r--r-- | PCbuild/kill_python.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/PCbuild/kill_python.c b/PCbuild/kill_python.c index 7fd4d94..8ee22e8 100644 --- a/PCbuild/kill_python.c +++ b/PCbuild/kill_python.c @@ -118,11 +118,15 @@ main(int argc, char **argv) /* It's a python process, so figure out which directory it's in... */
hsm = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pe.th32ProcessID);
- if (hsm == INVALID_HANDLE_VALUE) {
- printf("CreateToolhelp32Snapshot[3] failed: %d\n", GetLastError());
- CloseHandle(hsp);
- return 1;
- }
+ if (hsm == INVALID_HANDLE_VALUE)
+ /*
+ * If our module snapshot fails (which will happen if we don't own
+ * the process), just ignore it and continue. (It seems different
+ * versions of Windows return different values for GetLastError()
+ * in this situation; it's easier to just ignore it and move on vs.
+ * stopping the build for what could be a false positive.)
+ */
+ continue;
if (!Module32FirstW(hsm, &me)) {
printf("Module32FirstW[2] failed: %d\n", GetLastError());
|