fs: use unlink(2) for removing files
remove(3) just calls unlink(2) when the path points to a file
This commit is contained in:
parent
6d47426ea6
commit
6034b6ee60
1 changed files with 2 additions and 2 deletions
4
lfs.c
4
lfs.c
|
@ -518,7 +518,7 @@ recursiveremove(lua_State *L, const char *path)
|
||||||
return lfail(L);
|
return lfail(L);
|
||||||
|
|
||||||
/* if it's a file... */
|
/* if it's a file... */
|
||||||
if (remove(path) == -1)
|
if (unlink(path) == -1)
|
||||||
return lfail(L);
|
return lfail(L);
|
||||||
|
|
||||||
lua_pushboolean(L, 1);
|
lua_pushboolean(L, 1);
|
||||||
|
@ -551,7 +551,7 @@ recursiveremove(lua_State *L, const char *path)
|
||||||
else /* if some other error occurred */
|
else /* if some other error occurred */
|
||||||
return lfail(L);
|
return lfail(L);
|
||||||
} else {
|
} else {
|
||||||
if (remove(fullname) == -1)
|
if (unlink(fullname) == -1)
|
||||||
return lfail(L);
|
return lfail(L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue