mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-24 20:33:06 +00:00
removed umask calls in lfs.mkdir, see kepler-list message from Enrico at 2009-12-27
This commit is contained in:
@@ -367,10 +367,8 @@ static int make_dir (lua_State *L) {
|
|||||||
const char *path = luaL_checkstring (L, 1);
|
const char *path = luaL_checkstring (L, 1);
|
||||||
int fail;
|
int fail;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
int oldmask = umask (0);
|
|
||||||
fail = _mkdir (path);
|
fail = _mkdir (path);
|
||||||
#else
|
#else
|
||||||
mode_t oldmask = umask( (mode_t)0 );
|
|
||||||
fail = mkdir (path, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP |
|
fail = mkdir (path, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP |
|
||||||
S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH );
|
S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH );
|
||||||
#endif
|
#endif
|
||||||
@@ -379,7 +377,6 @@ static int make_dir (lua_State *L) {
|
|||||||
lua_pushfstring (L, "%s", strerror(errno));
|
lua_pushfstring (L, "%s", strerror(errno));
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
umask (oldmask);
|
|
||||||
lua_pushboolean (L, 1);
|
lua_pushboolean (L, 1);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user