1 Star 0 Fork 10

liuzhiqiang/sysfsutils

forked from src-openEuler/sysfsutils 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0008-Use-stat-not-lstat-to-find-link-target.patch 749 Bytes
一键复制 编辑 原始数据 按行查看 历史
From e92be090a8a82c679a65bc0c885e259c3c64cc51 Mon Sep 17 00:00:00 2001
From: Lee Duncan <lduncan@suse.com>
Date: Thu, 25 Jun 2020 10:04:40 -0700
Subject: [PATCH 8/9] Use stat() not lstat() to find link target.
The test was backwards? We are trying to find what the
link points at, not info about the link.
Signed-off-by: Lee Duncan <lduncan@suse.com>
---
test/test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/test.c b/test/test.c
index f63e346..aea34c1 100644
--- a/test/test.c
+++ b/test/test.c
@@ -165,7 +165,7 @@ static int path_is_dir(const char *path)
{
struct stat astats;
- if ((lstat(path, &astats)) != 0)
+ if ((stat(path, &astats)) != 0)
goto direrr;
if (S_ISDIR(astats.st_mode))
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liuzhiqiang26/sysfsutils.git
git@gitee.com:liuzhiqiang26/sysfsutils.git
liuzhiqiang26
sysfsutils
sysfsutils
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385