From: divverent Date: Fri, 18 Nov 2011 11:02:25 +0000 (+0000) Subject: make locksession a bit more robust by calling FS_CreatePath just in case X-Git-Tag: xonotic-v0.6.0~102^2~55 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=10bd0252cda8b1989bdc0801174e58a920d22a19;p=xonotic%2Fdarkplaces.git make locksession a bit more robust by calling FS_CreatePath just in case git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11564 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/host.c b/host.c index a8a8e0de..d08795a2 100644 --- a/host.c +++ b/host.c @@ -1100,17 +1100,19 @@ void Host_LockSession(void) if(locksession.integer != 0) { char vabuf[1024]; - locksession_fh = FS_SysOpen(va(vabuf, sizeof(vabuf), "%slock%s", *fs_userdir ? fs_userdir : fs_basedir, sessionid.string), "wl", false); + char *p = va(vabuf, sizeof(vabuf), "%slock%s", *fs_userdir ? fs_userdir : fs_basedir, sessionid.string); + FS_CreatePath(p); + locksession_fh = FS_SysOpen(p, "wl", false); // TODO maybe write the pid into the lockfile, while we are at it? may help server management tools if(!locksession_fh) { if(locksession.integer == 2) { - Con_Printf("WARNING: session lock %slock%s could not be acquired. Please run with -sessionid and an unique session name. Continuing anyway.\n", *fs_userdir ? fs_userdir : fs_basedir, sessionid.string); + Con_Printf("WARNING: session lock %s could not be acquired. Please run with -sessionid and an unique session name. Continuing anyway.\n", p); } else { - Sys_Error("session lock %slock%s could not be acquired. Please run with -sessionid and an unique session name.\n", *fs_userdir ? fs_userdir : fs_basedir, sessionid.string); + Sys_Error("session lock %s could not be acquired. Please run with -sessionid and an unique session name.\n", p); } } }