You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/10/14 10:34:29 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7311: Fix in rename() when old file doesn't exist.

xiaoxiang781216 commented on code in PR #7311:
URL: https://github.com/apache/incubator-nuttx/pull/7311#discussion_r995616148


##########
fs/vfs/fs_rename.c:
##########
@@ -472,6 +473,14 @@ int rename(FAR const char *oldpath, FAR const char *newpath)
       goto errout;
     }
 
+  /* Ensure that oldpath actually exists */
+
+  ret = nx_stat(oldpath, &stat_buf, 0);

Review Comment:
   move the check to mountptrename, so we don't search the old patch twice



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org