Adopted LFS3_ERR_BUSY for root-related errors

Now that we use LFS3_ERR_BUSY for traversals, we no longer have an
excuse for not returning LFS3_ERR_BUSY on root-related errors:

- lfs3_remove(&lfs3, "/") => LFS3_ERR_BUSY
- lfs3_rename(&lfs3, "/", *) => LFS3_ERR_BUSY
- lfs3_rename(&lfs3, *, "/") => LFS3_ERR_BUSY

This better aligns with POSIX. Arguably we should have defined
LFS3_ERR_BUSY for this case anyways, it's not like additional error
codes cost much.

No code changes.
This commit is contained in:
Christopher Haster
2025-11-09 01:02:18 -06:00
parent 4010afeafd
commit e196be53df
5 changed files with 47 additions and 47 deletions
+2 -2
View File
@@ -523,7 +523,7 @@ code = '''
lfs3_file_write(&lfs3, &file, wbuf, wsize) => wsize;
lfs3_file_close(&lfs3, &file) => 0;
lfs3_rename(&lfs3, "not_hello", "/") => LFS3_ERR_INVAL;
lfs3_rename(&lfs3, "not_hello", "/") => LFS3_ERR_BUSY;
for (int remount = 0; remount < 2; remount++) {
// remount?
@@ -2247,7 +2247,7 @@ code = '''
}
// rename the file
lfs3_rename(&lfs3, "amethyst", "/") => LFS3_ERR_INVAL;
lfs3_rename(&lfs3, "amethyst", "/") => LFS3_ERR_BUSY;
for (int remount = 0; remount < 2; remount++) {
// remount?