diff options
| author | ruki <[email protected]> | 2022-04-05 23:52:12 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-04-05 23:52:12 +0800 |
| commit | 43431946fbd66c1ff6c9726e93527efa7cf7dc98 (patch) | |
| tree | 30fa88458d5ac568fee81f62ba8d70023ee81533 /core/src | |
| parent | 314f11d73d924d8ff8340fb989a545149850dfda (diff) | |
revert gid uid
Diffstat (limited to 'core/src')
| -rw-r--r-- | core/src/xmake/engine.c | 8 | ||||
| -rw-r--r-- | core/src/xmake/makefile | 4 | ||||
| -rw-r--r-- | core/src/xmake/os/gid.c (renamed from core/src/xmake/os/getgid.c) | 24 | ||||
| -rw-r--r-- | core/src/xmake/os/uid.c (renamed from core/src/xmake/os/getuid.c) | 24 |
4 files changed, 30 insertions, 30 deletions
diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c index e91e5ac3e..a2b43e12b 100644 --- a/core/src/xmake/engine.c +++ b/core/src/xmake/engine.c @@ -114,8 +114,8 @@ tb_int_t xm_os_strerror(lua_State* lua); tb_int_t xm_os_getwinsize(lua_State* lua); tb_int_t xm_os_getpid(lua_State* lua); #ifndef TB_CONFIG_OS_WINDOWS -tb_int_t xm_os_getuid(lua_State* lua); -tb_int_t xm_os_getgid(lua_State* lua); +tb_int_t xm_os_uid(lua_State* lua); +tb_int_t xm_os_gid(lua_State* lua); tb_int_t xm_os_getown(lua_State* lua); #endif @@ -292,8 +292,8 @@ static luaL_Reg const g_os_functions[] = , { "getwinsize", xm_os_getwinsize} , { "getpid", xm_os_getpid } #ifndef TB_CONFIG_OS_WINDOWS -, { "getuid", xm_os_getuid } -, { "getgid", xm_os_getgid } +, { "uid", xm_os_uid } +, { "gid", xm_os_gid } , { "getown", xm_os_getown } #endif , { tb_null, tb_null } diff --git a/core/src/xmake/makefile b/core/src/xmake/makefile index d82ff51f9..dbe9bc201 100644 --- a/core/src/xmake/makefile +++ b/core/src/xmake/makefile @@ -44,8 +44,8 @@ xmake_C_FILES += \ os/strerror \ os/filesize \ os/getwinsize \ - os/getuid \ - os/getgid \ + os/uid \ + os/gid \ os/getpid \ os/getown \ io/stdfile \ diff --git a/core/src/xmake/os/getgid.c b/core/src/xmake/os/gid.c index a089f855e..8a05cd145 100644 --- a/core/src/xmake/os/getgid.c +++ b/core/src/xmake/os/gid.c @@ -15,14 +15,14 @@ * Copyright (C) 2015-present, TBOOX Open Source Group. * * @author TitanSnow - * @file getgid.c + * @file gid.c * */ /* ////////////////////////////////////////////////////////////////////////////////////// * trace */ -#define TB_TRACE_MODULE_NAME "getgid" +#define TB_TRACE_MODULE_NAME "gid" #define TB_TRACE_MODULE_DEBUG (0) /* ////////////////////////////////////////////////////////////////////////////////////// @@ -40,7 +40,7 @@ #ifndef TB_CONFIG_OS_WINDOWS // get & set gid -tb_int_t xm_os_getgid(lua_State* lua) +tb_int_t xm_os_gid(lua_State* lua) { // check tb_assert_and_check_return_val(lua, 0); @@ -52,14 +52,14 @@ tb_int_t xm_os_getgid(lua_State* lua) { if (lua_istable(lua, 1)) { - // os.getgid({["rgid"] = rgid, ["egid"] = egid}) + // os.gid({["rgid"] = rgid, ["egid"] = egid}) lua_getfield(lua, 1, "rgid"); lua_getfield(lua, 1, "egid"); if (!lua_isnil(lua, -1)) { if (!lua_isnumber(lua, -1)) { - lua_pushfstring(lua, "invalid field type(%s) in `egid` for os.getgid", luaL_typename(lua, -1)); + lua_pushfstring(lua, "invalid field type(%s) in `egid` for os.gid", luaL_typename(lua, -1)); lua_error(lua); return 0; } @@ -70,7 +70,7 @@ tb_int_t xm_os_getgid(lua_State* lua) { if (!lua_isnumber(lua, -1)) { - lua_pushfstring(lua, "invalid field type(%s) in `rgid` for os.getgid", luaL_typename(lua, -1)); + lua_pushfstring(lua, "invalid field type(%s) in `rgid` for os.gid", luaL_typename(lua, -1)); lua_error(lua); return 0; } @@ -80,24 +80,24 @@ tb_int_t xm_os_getgid(lua_State* lua) } else if (lua_isnumber(lua, 1)) { - // os.getgid(gid) + // os.gid(gid) rgidset = egidset = (tb_int_t)lua_tonumber(lua, 1); } else { - lua_pushfstring(lua, "invalid argument type(%s) for os.getgid", luaL_typename(lua, 1)); + lua_pushfstring(lua, "invalid argument type(%s) for os.gid", luaL_typename(lua, 1)); lua_error(lua); return 0; } } else if (argc == 2) { - // os.getgid(rgid, egid) + // os.gid(rgid, egid) if (!lua_isnil(lua, 1)) { if (!lua_isnumber(lua, 1)) { - lua_pushfstring(lua, "invalid argument type(%s) for os.getgid", luaL_typename(lua, 1)); + lua_pushfstring(lua, "invalid argument type(%s) for os.gid", luaL_typename(lua, 1)); lua_error(lua); return 0; } @@ -107,7 +107,7 @@ tb_int_t xm_os_getgid(lua_State* lua) { if (!lua_isnumber(lua, 2)) { - lua_pushfstring(lua, "invalid argument type(%s) for os.getgid", luaL_typename(lua, 2)); + lua_pushfstring(lua, "invalid argument type(%s) for os.gid", luaL_typename(lua, 2)); lua_error(lua); return 0; } @@ -116,7 +116,7 @@ tb_int_t xm_os_getgid(lua_State* lua) } else if (argc != 0) { - lua_pushstring(lua, "invalid argument count for os.getgid"); + lua_pushstring(lua, "invalid argument count for os.gid"); lua_error(lua); return 0; } diff --git a/core/src/xmake/os/getuid.c b/core/src/xmake/os/uid.c index 9c2c2fa2c..bdaee036f 100644 --- a/core/src/xmake/os/getuid.c +++ b/core/src/xmake/os/uid.c @@ -15,14 +15,14 @@ * Copyright (C) 2015-present, TBOOX Open Source Group. * * @author TitanSnow - * @file getuid.c + * @file uid.c * */ /* ////////////////////////////////////////////////////////////////////////////////////// * trace */ -#define TB_TRACE_MODULE_NAME "getuid" +#define TB_TRACE_MODULE_NAME "uid" #define TB_TRACE_MODULE_DEBUG (0) /* ////////////////////////////////////////////////////////////////////////////////////// @@ -40,7 +40,7 @@ #ifndef TB_CONFIG_OS_WINDOWS // get & set uid -tb_int_t xm_os_getuid(lua_State* lua) +tb_int_t xm_os_uid(lua_State* lua) { // check tb_assert_and_check_return_val(lua, 0); @@ -52,14 +52,14 @@ tb_int_t xm_os_getuid(lua_State* lua) { if (lua_istable(lua, 1)) { - // os.getuid({["ruid"] = ruid, ["euid"] = euid}) + // os.uid({["ruid"] = ruid, ["euid"] = euid}) lua_getfield(lua, 1, "ruid"); lua_getfield(lua, 1, "euid"); if (!lua_isnil(lua, -1)) { if (!lua_isnumber(lua, -1)) { - lua_pushfstring(lua, "invalid field type(%s) in `euid` for os.getuid", luaL_typename(lua, -1)); + lua_pushfstring(lua, "invalid field type(%s) in `euid` for os.uid", luaL_typename(lua, -1)); lua_error(lua); return 0; } @@ -70,7 +70,7 @@ tb_int_t xm_os_getuid(lua_State* lua) { if (!lua_isnumber(lua, -1)) { - lua_pushfstring(lua, "invalid field type(%s) in `ruid` for os.getuid", luaL_typename(lua, -1)); + lua_pushfstring(lua, "invalid field type(%s) in `ruid` for os.uid", luaL_typename(lua, -1)); lua_error(lua); return 0; } @@ -80,24 +80,24 @@ tb_int_t xm_os_getuid(lua_State* lua) } else if (lua_isnumber(lua, 1)) { - // os.getuid(uid) + // os.uid(uid) ruidset = euidset = (tb_int_t)lua_tonumber(lua, 1); } else { - lua_pushfstring(lua, "invalid argument type(%s) for os.getuid", luaL_typename(lua, 1)); + lua_pushfstring(lua, "invalid argument type(%s) for os.uid", luaL_typename(lua, 1)); lua_error(lua); return 0; } } else if (argc == 2) { - // os.getuid(ruid, euid) + // os.uid(ruid, euid) if (!lua_isnil(lua, 1)) { if (!lua_isnumber(lua, 1)) { - lua_pushfstring(lua, "invalid argument type(%s) for os.getuid", luaL_typename(lua, 1)); + lua_pushfstring(lua, "invalid argument type(%s) for os.uid", luaL_typename(lua, 1)); lua_error(lua); return 0; } @@ -107,7 +107,7 @@ tb_int_t xm_os_getuid(lua_State* lua) { if (!lua_isnumber(lua, 2)) { - lua_pushfstring(lua, "invalid argument type(%s) for os.getuid", luaL_typename(lua, 2)); + lua_pushfstring(lua, "invalid argument type(%s) for os.uid", luaL_typename(lua, 2)); lua_error(lua); return 0; } @@ -116,7 +116,7 @@ tb_int_t xm_os_getuid(lua_State* lua) } else if (argc != 0) { - lua_pushstring(lua, "invalid argument count for os.getuid"); + lua_pushstring(lua, "invalid argument count for os.uid"); lua_error(lua); return 0; } |
