From 7453eaaf0b690420ef2359f022a1838ad697b441 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 26 Feb 2008 10:46:50 +0000 Subject: [PATCH] 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. --- rts/posix/FileLock.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 1.7.10.4