From: Simon Marlow Date: Tue, 26 Feb 2008 10:46:50 +0000 (+0000) Subject: FIX #2122: file locking bug X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=7453eaaf0b690420ef2359f022a1838ad697b441 FIX #2122: file locking bug Second and subsequent readers weren't being inserted into the fd->lock hash table, which meant that the file wasn't correctly unlocked when the Handles were closed. --- diff --git a/rts/posix/FileLock.c b/rts/posix/FileLock.c index 436d8c9..8d25820 100644 --- a/rts/posix/FileLock.c +++ b/rts/posix/FileLock.c @@ -88,6 +88,7 @@ lockFile(int fd, dev_t dev, ino_t ino, int for_writing) if (for_writing || lock->readers < 0) { return -1; } + insertHashTable(fd_hash, fd, lock); lock->readers++; return 0; }