about summary refs log tree commit diff
path: root/src/devices/bluetooth
diff options
context:
space:
mode:
authorAron Xu <aron@debian.org>2016-12-20 20:07:38 +0800
committerAron Xu <aron@debian.org>2016-12-20 20:07:38 +0800
commit3bf5cabfc7d7a3c7fdb4e2bc3d771d2a07db8bc0 (patch)
tree1ac587c7e73af842b847599dc29b44430bf112ff /src/devices/bluetooth
parent1836daa45f4f0d8d0b791ed020774b915e9dd92d (diff)
parent45cb5bb3c0e6edb887cf69b417fcaf7053814a9b (diff)
Merge tag 'upstream/1.4.4'
Upstream version 1.4.4
Diffstat (limited to 'src/devices/bluetooth')
-rw-r--r--src/devices/bluetooth/nm-bluez5-dun.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/devices/bluetooth/nm-bluez5-dun.c b/src/devices/bluetooth/nm-bluez5-dun.c
index 4c93feba..aba3a0dd 100644
--- a/src/devices/bluetooth/nm-bluez5-dun.c
+++ b/src/devices/bluetooth/nm-bluez5-dun.c
@@ -64,7 +64,7 @@ dun_connect (NMBluez5DunContext *context)
 		.channel = context->rfcomm_channel
 	};
 
-	context->rfcomm_fd = socket (AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
+	context->rfcomm_fd = socket (AF_BLUETOOTH, SOCK_STREAM | SOCK_CLOEXEC, BTPROTO_RFCOMM);
 	if (context->rfcomm_fd < 0) {
 		int errsv = errno;
 		error = g_error_new (NM_BT_ERROR, NM_BT_ERROR_DUN_CONNECT_FAILED,
@@ -112,7 +112,7 @@ dun_connect (NMBluez5DunContext *context)
 	context->rfcomm_id = devid;
 
 	snprintf (tty, ttylen, "/dev/rfcomm%d", devid);
-	while ((context->rfcomm_tty_fd = open (tty, O_RDONLY | O_NOCTTY)) < 0 && try--) {
+	while ((context->rfcomm_tty_fd = open (tty, O_RDONLY | O_NOCTTY | O_CLOEXEC)) < 0 && try--) {
 		if (try) {
 			g_usleep (100 * 1000);
 			continue;