diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2004-12-25 17:43:16 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2004-12-25 17:43:16 +0000 |
commit | bbda499067067aefc8e642a2784d247ac0331eae (patch) | |
tree | a702f2c2ba1716b29c5f3b4d019c4590330ff461 /test/hstest.c | |
parent | ac243219976dab3363bcd3215f963eb0026af788 (diff) |
Add memset() to different places to initialize the structures
Diffstat (limited to 'test/hstest.c')
-rw-r--r-- | test/hstest.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/hstest.c b/test/hstest.c index 98428b68e..f269621cf 100644 --- a/test/hstest.c +++ b/test/hstest.c @@ -98,6 +98,7 @@ static int sco_connect(bdaddr_t *src, bdaddr_t *dst, uint16_t *handle, uint16_t memset(&addr, 0, sizeof(addr)); addr.sco_family = AF_BLUETOOTH; bacpy(&addr.sco_bdaddr, src); + if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) { close(s); return -1; @@ -106,18 +107,23 @@ static int sco_connect(bdaddr_t *src, bdaddr_t *dst, uint16_t *handle, uint16_t memset(&addr, 0, sizeof(addr)); addr.sco_family = AF_BLUETOOTH; bacpy(&addr.sco_bdaddr, dst); + if (connect(s, (struct sockaddr *)&addr, sizeof(addr)) < 0 ){ close(s); return -1; } + memset(&conn, 0, sizeof(conn)); size = sizeof(conn); + if (getsockopt(s, SOL_SCO, SCO_CONNINFO, &conn, &size) < 0) { close(s); return -1; } + memset(&opts, 0, sizeof(opts)); size = sizeof(opts); + if (getsockopt(s, SOL_SCO, SCO_OPTIONS, &opts, &size) < 0) { close(s); return -1; |