aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2014-01-08 06:53:06 -0800
committerHisham Muhammad <hisham@gobolinux.org>2014-01-08 06:53:06 -0800
commit5be0c7156e0d34e3379cb13e9d487a069ac07557 (patch)
tree634cb3020db94077af9f94b3646582e3ab7964df /src
parent2b80db36f00dc3ac46724b1c128f734eecac181d (diff)
parentcc6007171bc30aaa2508d88bef58f40235ef1e63 (diff)
downloadluafilesystem-5be0c7156e0d34e3379cb13e9d487a069ac07557.tar.gz
luafilesystem-5be0c7156e0d34e3379cb13e9d487a069ac07557.tar.bz2
luafilesystem-5be0c7156e0d34e3379cb13e9d487a069ac07557.zip
Merge pull request #28 from moteus/patch-1
Fix. Prevents double close the same handle (#24)
Diffstat (limited to 'src')
-rw-r--r--src/lfs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lfs.c b/src/lfs.c
index b7c4fcd..ccbba5e 100644
--- a/src/lfs.c
+++ b/src/lfs.c
@@ -281,7 +281,10 @@ static int lfs_lock_dir(lua_State *L) {
281} 281}
282static int lfs_unlock_dir(lua_State *L) { 282static int lfs_unlock_dir(lua_State *L) {
283 lfs_Lock *lock = luaL_checkudata(L, 1, LOCK_METATABLE); 283 lfs_Lock *lock = luaL_checkudata(L, 1, LOCK_METATABLE);
284 CloseHandle(lock->fd); 284 if(lock->fd != INVALID_HANDLE_VALUE) {
285 CloseHandle(lock->fd);
286 lock->fd=INVALID_HANDLE_VALUE;
287 }
285 return 0; 288 return 0;
286} 289}
287#else 290#else