summaryrefslogtreecommitdiff
path: root/src/rfkill.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-10-23 14:16:25 +0200
committerMarcel Holtmann <marcel@holtmann.org>2011-10-25 13:34:51 +0200
commitc94b607044db60e5ff6a4b0a861a90bee35b3bc0 (patch)
tree09d8a4eb547fe5e908127444d14613106a4c8fb7 /src/rfkill.c
parentbd972fef32de3560bbe23ef41ba2281b696764fd (diff)
downloadconnman-c94b607044db60e5ff6a4b0a861a90bee35b3bc0.tar.gz
connman-c94b607044db60e5ff6a4b0a861a90bee35b3bc0.tar.bz2
connman-c94b607044db60e5ff6a4b0a861a90bee35b3bc0.zip
core: Add O_CLOEXEC to open()
Make sure all file descriptor are closed.
Diffstat (limited to 'src/rfkill.c')
-rw-r--r--src/rfkill.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rfkill.c b/src/rfkill.c
index 17592da9..6ad82797 100644
--- a/src/rfkill.c
+++ b/src/rfkill.c
@@ -172,7 +172,7 @@ int __connman_rfkill_block(enum connman_service_type type, connman_bool_t block)
if (rfkill_type == NUM_RFKILL_TYPES)
return -EINVAL;
- fd = open("/dev/rfkill", O_RDWR);
+ fd = open("/dev/rfkill", O_RDWR | O_CLOEXEC);
if (fd < 0)
return fd;
@@ -197,7 +197,7 @@ int __connman_rfkill_init(void)
DBG("");
- fd = open("/dev/rfkill", O_RDWR);
+ fd = open("/dev/rfkill", O_RDWR | O_CLOEXEC);
if (fd < 0) {
connman_error("Failed to open RFKILL control device");
return -EIO;