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

Commit 72d6269b authored by Elliott Hughes's avatar Elliott Hughes Committed by Gerrit Code Review
Browse files

Merge "Clean up CLOEXEC in qtaguid."

parents ed83cfba b4de99c6
Loading
Loading
Loading
Loading
+3 −6
Original line number Original line Diff line number Diff line
@@ -47,10 +47,7 @@ pthread_once_t resTrackInitDone = PTHREAD_ONCE_INIT;


/* Only call once per process. */
/* Only call once per process. */
void qtaguid_resTrack(void) {
void qtaguid_resTrack(void) {
    resTrackFd = TEMP_FAILURE_RETRY(open("/dev/xt_qtaguid", O_RDONLY));
    resTrackFd = TEMP_FAILURE_RETRY(open("/dev/xt_qtaguid", O_RDONLY | O_CLOEXEC));
    if (resTrackFd >=0) {
        TEMP_FAILURE_RETRY(fcntl(resTrackFd, F_SETFD, FD_CLOEXEC));
    }
}
}


/*
/*
@@ -63,7 +60,7 @@ static int write_ctrl(const char *cmd) {


    ALOGV("write_ctrl(%s)", cmd);
    ALOGV("write_ctrl(%s)", cmd);


    fd = TEMP_FAILURE_RETRY(open(CTRL_PROCPATH, O_WRONLY));
    fd = TEMP_FAILURE_RETRY(open(CTRL_PROCPATH, O_WRONLY | O_CLOEXEC));
    if (fd < 0) {
    if (fd < 0) {
        return -errno;
        return -errno;
    }
    }
@@ -85,7 +82,7 @@ static int write_param(const char *param_path, const char *value) {
    int param_fd;
    int param_fd;
    int res;
    int res;


    param_fd = TEMP_FAILURE_RETRY(open(param_path, O_WRONLY));
    param_fd = TEMP_FAILURE_RETRY(open(param_path, O_WRONLY | O_CLOEXEC));
    if (param_fd < 0) {
    if (param_fd < 0) {
        return -errno;
        return -errno;
    }
    }