[iortcw] 139/152: All: Fix removal of stale pid file from 'main'

Simon McVittie smcv at debian.org
Fri Sep 8 10:40:26 UTC 2017


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

smcv pushed a commit to annotated tag 1.5a
in repository iortcw.

commit 06c5e229e62b2430905afda80ef6beb52cfd1a76
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Thu Oct 20 11:10:27 2016 -0400

    All: Fix removal of stale pid file from 'main'
    
    A stale pid file is left in main when connecting to a mod server from the in-game browser.
    This is because lastValidGame is not set to anything on startup.
    Origin of issue was in f69dd5f
---
 MP/code/sys/sys_main.c | 7 ++++++-
 SP/code/sys/sys_main.c | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/MP/code/sys/sys_main.c b/MP/code/sys/sys_main.c
index b4181da..ce607f6 100644
--- a/MP/code/sys/sys_main.c
+++ b/MP/code/sys/sys_main.c
@@ -184,7 +184,12 @@ Sys_RemovePIDFile
 */
 void Sys_RemovePIDFile( const char *gamedir )
 {
-	char *pidFile = Sys_PIDFileName( gamedir );
+	char *pidFile;
+
+	if ( gamedir[0] == '\0' )
+		pidFile = Sys_PIDFileName( BASEGAME );
+	else
+		pidFile = Sys_PIDFileName( gamedir );
 
 	if( pidFile != NULL )
 		remove( pidFile );
diff --git a/SP/code/sys/sys_main.c b/SP/code/sys/sys_main.c
index d24f402..fac8197 100644
--- a/SP/code/sys/sys_main.c
+++ b/SP/code/sys/sys_main.c
@@ -184,7 +184,12 @@ Sys_RemovePIDFile
 */
 void Sys_RemovePIDFile( const char *gamedir )
 {
-	char *pidFile = Sys_PIDFileName( gamedir );
+	char *pidFile;
+
+	if ( gamedir[0] == '\0' )
+		pidFile = Sys_PIDFileName( BASEGAME );
+	else
+		pidFile = Sys_PIDFileName( gamedir );
 
 	if( pidFile != NULL )
 		remove( pidFile );

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



More information about the Pkg-games-commits mailing list