summaryrefslogtreecommitdiffhomepage
path: root/lib/fs.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-07-28 12:34:04 +0200
committerJo-Philipp Wich <jo@mein.io>2021-07-28 12:34:04 +0200
commit8f34d70c00cb7c17140f920234f04af1ddbdfbf4 (patch)
tree54ee5a205c4dee4a39ae78c64a619731effd686a /lib/fs.c
parent03ca44543740450b21ccb8754099147219e44043 (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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/fs.c b/lib/fs.c
index 485dfb1..d51f61b 100644
--- a/lib/fs.c
+++ b/lib/fs.c
@@ -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);
}