Fix return value when path is invalid in rename function
It should set error code and return ERROR
@@ -123,7 +123,8 @@ int rename(FAR const char *oldpath, FAR const char *newpath)
*/
if (!oldpath || *oldpath == '\0' || oldpath[0] != '/' || !newpath || *newpath == '\0' || newpath[0] != '/') {
- return -EINVAL;
+ errcode = EINVAL;
+ goto errout;
}
/* Get an inode that includes the oldpath */
