Merge "Clean up CLOEXEC in qtaguid."
am: 72d6269b6e
* commit '72d6269b6efda3e43a119de048b87758ff970184':
Clean up CLOEXEC in qtaguid.
This commit is contained in:
commit
2d0899a3b4
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. */
|
||||
void qtaguid_resTrack(void) {
|
||||
resTrackFd = TEMP_FAILURE_RETRY(open("/dev/xt_qtaguid", O_RDONLY));
|
||||
if (resTrackFd >=0) {
|
||||
TEMP_FAILURE_RETRY(fcntl(resTrackFd, F_SETFD, FD_CLOEXEC));
|
||||
}
|
||||
resTrackFd = TEMP_FAILURE_RETRY(open("/dev/xt_qtaguid", O_RDONLY | O_CLOEXEC));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -63,7 +60,7 @@ static int write_ctrl(const char *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) {
|
||||
return -errno;
|
||||
}
|
||||
|
@ -85,7 +82,7 @@ static int write_param(const char *param_path, const char *value) {
|
|||
int param_fd;
|
||||
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) {
|
||||
return -errno;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue