提交 f2861ddf 编写于 作者: F Far

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

调用futime时,系统调用接口函数直接使用了file结构体的f_path字段,该字段在退出前被错误地释放了。
避免该问题需要拷贝一份路径
Signed-off-by: NFar <yesiyuan2@huawei.com>
Change-Id: I519ccb38bec323c93aa8cff920143bb3f9931c22
上级 c18b5118
......@@ -119,7 +119,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.
先完成此消息的编辑!
想要评论请 注册