[ioquake3] 81/136: Don't fail if the game process went away before we were ready to wait for it.

Simon McVittie smcv at debian.org
Thu Jun 15 09:09:12 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian/master
in repository ioquake3.

commit cd4aa2d9a9cffc5e600bbccc152397c8d5f744cc
Author: Ryan C. Gordon <icculus at icculus.org>
Date:   Fri Jun 2 01:32:33 2017 -0400

    Don't fail if the game process went away before we were ready to wait for it.
---
 code/autoupdater/autoupdater.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/code/autoupdater/autoupdater.c b/code/autoupdater/autoupdater.c
index 3a2d17b..7c0ceba 100644
--- a/code/autoupdater/autoupdater.c
+++ b/code/autoupdater/autoupdater.c
@@ -189,7 +189,12 @@ static void windowsWaitForProcessToDie(const DWORD pid)
     infof("Waiting on process ID #%u", (unsigned int) pid);
     h = OpenProcess(SYNCHRONIZE, FALSE, pid);
     if (!h) {
-// !!! FIXME: what does this return if process is already dead?  
+        const DWORD err = GetLastError();
+        if (err == ERROR_INVALID_PARAMETER) {
+            info("No such process; probably already dead. Carry on.");
+            return;  /* process is (probably) already gone. */
+        }
+        infof("OpenProcess failed. err=%d", (unsigned int) err);
         die("OpenProcess failed");
     }
     if (WaitForSingleObject(h, INFINITE) != WAIT_OBJECT_0) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git



More information about the Pkg-games-commits mailing list