summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2013-06-20 13:31:26 +0100
committerRussell King <rmk@arm.linux.org.uk>2013-06-20 13:31:26 +0100
commitdde5602fbe9619ad1caafbfdaad47b9605da1ffa (patch)
tree2639b18d68c02163adc374d200f9d1df5f7ab893
parentd752ee23c4f0db5edd5c1ac686c8871174ff8ffc (diff)
Open the bmm device with O_CLOEXEC
We don't want to pass the BMM file descriptor to child programs, so ensure that it is opened using the O_CLOEXEC flag to prevent that happening.
-rw-r--r--bmm_lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bmm_lib.c b/bmm_lib.c
index d92ca39..1a4063c 100644
--- a/bmm_lib.c
+++ b/bmm_lib.c
@@ -36,7 +36,7 @@ int bmm_init()
{
/* attempt to open the BMM driver */
if(bmm_fd < 0) {
- bmm_fd = open(BMM_DEVICE_FILE, O_RDWR);
+ bmm_fd = open(BMM_DEVICE_FILE, O_RDWR | O_CLOEXEC);
pr_debug("BMM device fd: %d\n", bmm_fd);
}