From 8f34d70c00cb7c17140f920234f04af1ddbdfbf4 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 28 Jul 2021 12:34:04 +0200 Subject: fs: fix chown() and rename() error return values Fixes: dfb7379 ("fs: implement chmod(), chown(), rename() and glob() functions") Signed-off-by: Jo-Philipp Wich --- lib/fs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/fs.c') 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); } -- cgit v1.2.3