From 6e010033036592abd6d1fbd2f0abf4f7e1557108 Mon Sep 17 00:00:00 2001 From: Joshua Kwan Date: Fri, 13 Feb 2004 23:15:03 +0000 Subject: [PATCH] Maybe this'll do it. git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@234 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- Changelog | 5 ++++- dgamelaunch.c | 10 +--------- ttyrec.c | 1 - 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Changelog b/Changelog index cedabc7..55809eb 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,8 @@ 1.4.1 (2004/02/13) - * Call fcntl with F_SETLK, not F_UNLCK. + * Don't explicitly unlock the lock file before fclosing it; + this creates a race condition where we might not have finished + writing to /dgl-login before we tell people that they can write + to it again. * Make sure writefile does not get called when using it as a password prompt for new-users * Allow user to change his or her email address in the console. diff --git a/dgamelaunch.c b/dgamelaunch.c index 466a6e6..6102175 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -459,13 +459,9 @@ populate_games (int *l) /* clean dead ones */ unlink (fullname); } - fl.l_type = F_UNLCK; - - fcntl (fd, F_SETLK, &fl); + close (fd); fl.l_type = F_WRLCK; - - close (fd); } closedir (pdir); @@ -1167,11 +1163,7 @@ readfile (int nolock) } if (!nolock) - { - fl.l_type = F_UNLCK; - fcntl (fileno(fpl), F_SETLK, &fl); fclose (fpl); - } fclose (fp); return 0; } diff --git a/ttyrec.c b/ttyrec.c index 1777d7e..b212358 100644 --- a/ttyrec.c +++ b/ttyrec.c @@ -61,7 +61,6 @@ # include #endif #include -#include #include "ttyrec.h" #include "io.h"