[smart] fixup errno passing on sys_mkdir() (#9007)

Use _SYS_WRAP to fetch errno on return of mkdir to avoiding overriding
of it on other system APIs.

Signed-off-by: Shell <smokewood@qq.com>
This commit is contained in:
Shell 2024-05-29 18:06:54 +08:00 committed by GitHub
parent f179ce12b7
commit 63591d935e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -4842,11 +4842,11 @@ sysret_t sys_mkdir(const char *path, mode_t mode)
return -EINVAL;
}
err = mkdir(kpath, mode);
err = _SYS_WRAP(mkdir(kpath, mode));
kmem_put(kpath);
return (err < 0 ? GET_ERRNO() : err);
return err;
#else
int ret = mkdir(path, mode);
return (ret < 0 ? GET_ERRNO() : ret);