diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2005-01-23 19:46:10 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2005-01-23 19:46:10 +0000 |
commit | 3524d98e35685875e95daee7fa86a9c2178264a4 (patch) | |
tree | f611b68943ec23f513c59eaa38bee10e13a40c39 /test | |
parent | ba53bc4c8888a3dee5214b25a1f8f846ea8b5bc4 (diff) |
Only set link mode when needed
Diffstat (limited to 'test')
-rw-r--r-- | test/l2test.c | 2 | ||||
-rw-r--r-- | test/rctest.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/test/l2test.c b/test/l2test.c index e9a7d50d..06233d3f 100644 --- a/test/l2test.c +++ b/test/l2test.c @@ -286,7 +286,7 @@ static void do_listen(void (*handler)(int sk)) if (secure) opt |= L2CAP_LM_SECURE; - if (setsockopt(s, SOL_L2CAP, L2CAP_LM, &opt, sizeof(opt)) < 0) { + if (opt && setsockopt(s, SOL_L2CAP, L2CAP_LM, &opt, sizeof(opt)) < 0) { syslog(LOG_ERR, "Can't set L2CAP link mode: %s (%d)", strerror(errno), errno); exit(1); } diff --git a/test/rctest.c b/test/rctest.c index b7916a34..8298ab07 100644 --- a/test/rctest.c +++ b/test/rctest.c @@ -164,7 +164,7 @@ static void do_listen(void (*handler)(int sk)) if (secure) opt |= RFCOMM_LM_SECURE; - if (setsockopt(s, SOL_RFCOMM, RFCOMM_LM, &opt, sizeof(opt)) < 0) { + if (opt && setsockopt(s, SOL_RFCOMM, RFCOMM_LM, &opt, sizeof(opt)) < 0) { syslog(LOG_ERR, "Can't set RFCOMM link mode: %s (%d)", strerror(errno), errno); exit(1); } |