[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:
parent
f179ce12b7
commit
63591d935e
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue