From 3e398cf349c1ff3b9e9ebfa92f9dff99dfa8a97f Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 31 Aug 2022 00:50:20 +0800 Subject: revert islink --- core/src/xmake/os/islink.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'core/src') diff --git a/core/src/xmake/os/islink.c b/core/src/xmake/os/islink.c index d70681cb5..c7fec236e 100644 --- a/core/src/xmake/os/islink.c +++ b/core/src/xmake/os/islink.c @@ -46,7 +46,16 @@ tb_int_t xm_os_islink(lua_State* lua) tb_check_return_val(path, 0); // is link? - tb_file_info_t info = {0}; - lua_pushboolean(lua, tb_file_info(path, &info) && (info.flags & TB_FILE_FLAG_LINK)); +#if defined(TB_CONFIG_OS_WINDOWS) + lua_pushboolean(lua, tb_false); +#elif defined(TB_CONFIG_POSIX_HAVE_STAT64) + struct stat64 st = {0}; + lua_pushboolean(lua, !lstat64(path, &st) && S_ISLNK(st.st_mode)); +#else + struct stat st = {0}; + lua_pushboolean(lua, !lstat(path, &st) && S_ISLNK(st.st_mode)); +#endif + + // ok return 1; } -- cgit v1.3.1