!776 修复toybox mv指令能够移动成功,但提示错误22的BUG

Merge pull request !776 from Far/master
This commit is contained in:
openharmony_ci 2022-01-12 02:22:29 +00:00 committed by Gitee
commit b0c046f8ac
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 4 additions and 1 deletions

View File

@ -119,7 +119,10 @@ static int GetFullpathNull(int fd, const char *path, char **filePath)
if (ret < 0) { if (ret < 0) {
return -get_errno(); return -get_errno();
} }
fullPath = file->f_path; fullPath = strdup(file->f_path);
if (fullPath == NULL) {
ret = -ENOMEM;
}
} else { } else {
ret = GetFullpath(fd, path, &fullPath); ret = GetFullpath(fd, path, &fullPath);
if (ret < 0) { if (ret < 0) {