Clean up CLOEXEC in qtaguid.

Change-Id: Ie14579b6c42340789b8b99009acc136dc4d1be4a
This commit is contained in:
Elliott Hughes 2016-02-19 18:13:51 -08:00
parent fbaefc4d9d
commit b4de99c6dd

View file

@ -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;
}