提交 8e6f3f1b 编写于 作者: F Far

fix: 修复futime提示错误22的BUG

调用futime时,系统调用接口函数直接使用了file结构体的f_path字段,该字段在退出前被错误地释放了。
避免该问题需要拷贝一份路径
Signed-off-by: NFar <yesiyuan2@huawei.com>
Change-Id: Ic0f8e608363da3ed15e252a3f91c46e8397c245e
上级 88a0caae
......@@ -118,7 +118,10 @@ static int GetFullpathNull(int fd, const char *path, char **filePath)
if (ret < 0) {
return -get_errno();
}
fullPath = file->f_path;
fullPath = strdup(file->f_path);
if (fullPath == NULL) {
ret = -ENOMEM;
}
} else {
ret = GetFullpath(fd, path, &fullPath);
if (ret < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册