diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2014-01-08 06:53:06 -0800 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2014-01-08 06:53:06 -0800 |
commit | 5be0c7156e0d34e3379cb13e9d487a069ac07557 (patch) | |
tree | 634cb3020db94077af9f94b3646582e3ab7964df /src | |
parent | 2b80db36f00dc3ac46724b1c128f734eecac181d (diff) | |
parent | cc6007171bc30aaa2508d88bef58f40235ef1e63 (diff) | |
download | luafilesystem-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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -281,7 +281,10 @@ static int lfs_lock_dir(lua_State *L) { | |||
281 | } | 281 | } |
282 | static int lfs_unlock_dir(lua_State *L) { | 282 | static 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 |