From 874c1e9aa598b45e7114a69ecb4194c167a8b39d Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Thu, 19 Jan 2012 14:32:47 -0800 Subject: Use O_CLOEXEC when opening input device. Change-Id: I931614ef4fe2143c9e124c3239d74a4a2ce3816c --- services/input/EventHub.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services/input/EventHub.cpp') diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp index ee9824ef1bbc..296c95ec937e 100644 --- a/services/input/EventHub.cpp +++ b/services/input/EventHub.cpp @@ -831,7 +831,7 @@ status_t EventHub::openDeviceLocked(const char *devicePath) { ALOGV("Opening device: %s", devicePath); - int fd = open(devicePath, O_RDWR); + int fd = open(devicePath, O_RDWR | O_CLOEXEC); if(fd < 0) { ALOGE("could not open %s, %s\n", devicePath, strerror(errno)); return -1; -- cgit v1.2.3-59-g8ed1b