aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author云风 <cloudwu@gmail.com>2018-11-14 10:39:38 +0800
committerHisham Muhammad <hisham@gobolinux.org>2020-04-21 18:36:43 -0300
commita5336d294d27f98c38394b6ea441e68bab96bdc8 (patch)
tree6fdc5a36d1053b5794dad63cb910d6cde2d18ceb
parent6048863a96779db026d369dccb92d53076490065 (diff)
downloadluafilesystem-a5336d294d27f98c38394b6ea441e68bab96bdc8.tar.gz
luafilesystem-a5336d294d27f98c38394b6ea441e68bab96bdc8.tar.bz2
luafilesystem-a5336d294d27f98c38394b6ea441e68bab96bdc8.zip
Use CREATE_ALWAYS instead of CREATE_NEW
-rw-r--r--src/lfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lfs.c b/src/lfs.c
index 5ba2df9..cc9d1cd 100644
--- a/src/lfs.c
+++ b/src/lfs.c
@@ -382,7 +382,7 @@ static int lfs_lock_dir(lua_State *L) {
382 lua_pushnil(L); lua_pushstring(L, strerror(errno)); return 2; 382 lua_pushnil(L); lua_pushstring(L, strerror(errno)); return 2;
383 } 383 }
384 strcpy(ln, path); strcat(ln, lockfile); 384 strcpy(ln, path); strcat(ln, lockfile);
385 fd = CreateFile(ln, GENERIC_WRITE, 0, NULL, CREATE_NEW, 385 fd = CreateFile(ln, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
386 FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, NULL); 386 FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, NULL);
387 free(ln); 387 free(ln);
388 if(fd == INVALID_HANDLE_VALUE) { 388 if(fd == INVALID_HANDLE_VALUE) {