Skip to content

Commit 44be0dc

Browse files
committed
Fix regression bug regarding locking
If get_dbf_head() failed the database file was not unlocked, what could cause deadlocks on Windows. git-svn-id: http://svn.php.net/repository/pecl/dbase/trunk@340807 c90b9560-bf6c-de11-be94-00142212c4b1
1 parent c3398b7 commit 44be0dc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dbf_head.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ dbhead_t *dbf_open(char *dp, int o_flags)
285285
}
286286

287287
if ((dbh = get_dbf_head(fd)) == NULL) {
288+
php_flock(fd, LOCK_UN);
289+
close(fd);
288290
return NULL;
289291
}
290292

0 commit comments

Comments
 (0)