diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2024-10-31 18:12:03 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2024-11-02 18:36:54 +0100 |
commit | ce5f448d3b690649a687e93dcdcfd59efe61ed28 (patch) | |
tree | 50e5f1f9e1c759edfb0672386bb059676d3b2e60 /utils.c | |
parent | 2b48eb051473e240735f61f41dce1c6614ca39fd (diff) |
Switched OpenWrt GitHub Actions SDK to main branch
* fixed some SonarCloud complaints
* added more systemd CI tests
* fixed debian package scripts to obey remove/purge
* changed `chmod_chown()` error handling
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -400,7 +400,7 @@ int chmod_chown(char const * const path, mode_t mode, char const * const user, c { if (chmod(path, mode) != 0) { - return -errno; + return errno; } } @@ -415,7 +415,7 @@ int chmod_chown(char const * const path, mode_t mode, char const * const user, c retval = getpwnam_r(user, &pwd, buf, sizeof(buf), &result); if (result == NULL) { - return (retval != 0 ? -retval : -ENOENT); + return (retval != 0 ? retval : ENOENT); } path_uid = pwd.pw_uid; path_gid = pwd.pw_gid; @@ -432,7 +432,7 @@ int chmod_chown(char const * const path, mode_t mode, char const * const user, c retval = getgrnam_r(group, &grp, buf, sizeof(buf), &result); if (result == NULL) { - return (retval != 0 ? -retval : -ENOENT); + return (retval != 0 ? retval : ENOENT); } path_gid = grp.gr_gid; } @@ -441,7 +441,7 @@ int chmod_chown(char const * const path, mode_t mode, char const * const user, c { if (chown(path, path_uid, path_gid) != 0) { - return -errno; + return errno; } } |