summaryrefslogtreecommitdiff
path: root/plugins/tist.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-10-23 14:16:24 +0200
committerMarcel Holtmann <marcel@holtmann.org>2011-10-25 13:34:30 +0200
commitbd972fef32de3560bbe23ef41ba2281b696764fd (patch)
treece3e623b69f4152ec61847e82390ce29179bccfe /plugins/tist.c
parent4826f90b555f009972276be1fa945d81b435950a (diff)
downloadconnman-bd972fef32de3560bbe23ef41ba2281b696764fd.tar.gz
connman-bd972fef32de3560bbe23ef41ba2281b696764fd.tar.bz2
connman-bd972fef32de3560bbe23ef41ba2281b696764fd.zip
plugins: Add O_CLOEXEC to open()
Make sure all file descriptor are closed.
Diffstat (limited to 'plugins/tist.c')
-rw-r--r--plugins/tist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/tist.c b/plugins/tist.c
index b8c89cfd..9b0d3f7a 100644
--- a/plugins/tist.c
+++ b/plugins/tist.c
@@ -370,7 +370,7 @@ static int install_ldisc(GIOChannel *channel, gboolean install)
DBG("opening %s custom baud %lu", uart_dev_name, baud_rate);
- uart_fd = open(uart_dev_name, O_RDWR);
+ uart_fd = open(uart_dev_name, O_RDWR | O_CLOEXEC);
if (uart_fd < 0)
return -EIO;
@@ -522,7 +522,7 @@ static int tist_init(void)
return err;
}
- fd = open(TIST_SYSFS_INSTALL, O_RDONLY);
+ fd = open(TIST_SYSFS_INSTALL, O_RDONLY | O_CLOEXEC);
if (fd < 0) {
connman_error("Failed to open TI ST sysfs install file");
return -EIO;