Merge "Clean up CLOEXEC in qtaguid."
This commit is contained in:
commit
72d6269b6e
1 changed files with 3 additions and 6 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue