jingfei195887 opened a new pull request, #21671:
URL: https://github.com/apache/nuttx/pull/21671
## Summary
POSIX lists ENOENT for `rename()` when either `old` or `new` points to
an empty string. `rename()` returned EINVAL in that case. Return ENOENT.
## Impact
`rename("", new)` and `rename(old, "")` now fail with ENOENT instead of
EINVAL. Other paths are unchanged.
## Testing
Host: Ubuntu x86_64, gcc (Ubuntu 13.1.0-8ubuntu1~22.04) 13.1.0, master
03aea78639, `sim:nsh`. A small test
program calls `rename()` with an empty source, an empty destination, and
two valid paths:
| call | master | this PR |
|---|---|---|
| `rename("", "/tmp/dst")` | -1, EINVAL | -1, ENOENT |
| `rename("/tmp/src", "")` | -1, EINVAL | -1, ENOENT |
| `rename("/tmp/src", "/tmp/dst")` | 0 | 0 |
- `./tools/checkpatch.sh -g master..HEAD`: all checks pass.
- Make and CMake builds pass; `ostest` exits with status 0.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]