diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-07-28 12:34:04 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-07-28 12:34:04 +0200 |
commit | 8f34d70c00cb7c17140f920234f04af1ddbdfbf4 (patch) | |
tree | 54ee5a205c4dee4a39ae78c64a619731effd686a /lib/fs.c | |
parent | 03ca44543740450b21ccb8754099147219e44043 (diff) |
fs: fix chown() and rename() error return values
Fixes: dfb7379 ("fs: implement chmod(), chown(), rename() and glob() functions")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib/fs.c')
-rw-r--r-- | lib/fs.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -782,10 +782,10 @@ uc_fs_chown(uc_vm_t *vm, size_t nargs) if (!uc_fs_resolve_user(user, &uid) || !uc_fs_resolve_group(group, &gid)) - return NULL; + err_return(errno); if (chown(ucv_string_get(path), uid, gid) == -1) - return NULL; + err_return(errno); return ucv_boolean_new(true); } @@ -801,7 +801,7 @@ uc_fs_rename(uc_vm_t *vm, size_t nargs) err_return(EINVAL); if (rename(ucv_string_get(oldpath), ucv_string_get(newpath))) - return NULL; + err_return(errno); return ucv_boolean_new(true); } |