summaryrefslogtreecommitdiff
path: root/monitor/hcidump.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2012-11-04 06:22:26 +0100
committerMarcel Holtmann <marcel@holtmann.org>2012-11-04 06:22:26 +0100
commit2290fbb9f5f0d1aa5b4f2b5529d0427af0bf3479 (patch)
tree83d1bb73487ab52a8b271676c84e1540c5d9f4fd /monitor/hcidump.c
parent71d6558c19b647e30411d488b3983b4f9f67e149 (diff)
downloadbluez-2290fbb9f5f0d1aa5b4f2b5529d0427af0bf3479.tar.gz
monitor: Use SOCK_CLOEXEC and O_CLOEXEC
Diffstat (limited to 'monitor/hcidump.c')
-rw-r--r--monitor/hcidump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/monitor/hcidump.c b/monitor/hcidump.c
index 373d2f55f..4eb0a4939 100644
--- a/monitor/hcidump.c
+++ b/monitor/hcidump.c
@@ -62,7 +62,7 @@ static int open_hci_dev(uint16_t index)
struct hci_filter flt;
int fd, opt = 1;
- fd = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
+ fd = socket(AF_BLUETOOTH, SOCK_RAW | SOCK_CLOEXEC, BTPROTO_HCI);
if (fd < 0) {
perror("Failed to open channel");
return -1;
@@ -263,7 +263,7 @@ static int open_stack_internal(void)
struct hci_filter flt;
int fd, opt = 1;
- fd = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
+ fd = socket(AF_BLUETOOTH, SOCK_RAW | SOCK_CLOEXEC, BTPROTO_HCI);
if (fd < 0) {
perror("Failed to open channel");
return -1;