Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 758aeb7d authored by Bernhard Rosenkränzer's avatar Bernhard Rosenkränzer
Browse files

Make mkdirAndChown do what it claims to do



Currently, mkdirAndChown takes parameters for mode, uid and gid, but
ignores them and hardcodes 0750, AID_SYSTEM, AID_SYSTEM instead.
This doesn't matter much because so far its only invocation passes
exactly those values as parameters -- but clang complains about unused
parameters.

Might as well make the function do what it claims to do.

Change-Id: I5a8056be3278a0c5d0a576dbc061288aa0956a35
Signed-off-by: default avatarBernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
parent 3ef0460e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -279,12 +279,12 @@ static int mkdirAndChown(const char *path, mode_t mode, uid_t uid, gid_t gid)
{
    int ret;

    ret = mkdir(path, 0750);
    ret = mkdir(path, mode);
    if (ret < 0 && errno != EEXIST) {
        return -errno;
    }

    ret = chown(path, AID_SYSTEM, AID_SYSTEM);
    ret = chown(path, uid, gid);
    if (ret < 0) {
        ret = -errno;
        rmdir(path);