diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2014-03-14 09:59:26 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-03-14 13:29:33 +0200 |
commit | becfb8474278404dc704f13619da6a299d264cc3 (patch) | |
tree | 986386896b6e6c9eaa5895bc737f04726ee42b2f /unit/test-sdp.c | |
parent | 18f0cdaac11b07ad3a209bd6ba03ced11e99b714 (diff) | |
download | bluez-becfb8474278404dc704f13619da6a299d264cc3.tar.gz |
unit: prevent unintended use of glibc's error(3)
When building the test-sdp we don't want src/sdpd-request.c end up
using the incompatible GNU libc's error(3) instead of the intended
src/log.c's error().
This also fixes the following compile error on Alpine Linux with musl
libc which does not implement the error(3) GNU extension:
src/sdpd-request.o: In function `extract_des':
/home/ncopa/src/bluez/src/sdpd-request.c:126: undefined reference to `error'
src/sdpd-request.o: In function `process_request':
/home/ncopa/src/bluez/src/sdpd-request.c:1022: undefined reference to `error'
/home/ncopa/src/bluez/src/sdpd-request.c:1045: undefined reference to `error'
Diffstat (limited to 'unit/test-sdp.c')
-rw-r--r-- | unit/test-sdp.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/unit/test-sdp.c b/unit/test-sdp.c index 9b8234307..a89dbfca6 100644 --- a/unit/test-sdp.c +++ b/unit/test-sdp.c @@ -37,6 +37,7 @@ #include "lib/sdp_lib.h" #include "src/shared/util.h" +#include "src/log.h" #include "src/sdpd.h" struct sdp_pdu { @@ -128,12 +129,6 @@ static void sdp_debug(const char *str, void *user_data) g_print("%s%s\n", prefix, str); } -void btd_debug(const char *format, ...); - -void btd_debug(const char *format, ...) -{ -} - static void context_quit(struct context *context) { g_main_loop_quit(context->main_loop); @@ -797,6 +792,9 @@ int main(int argc, char *argv[]) { g_test_init(&argc, &argv, NULL); + if (g_test_verbose()) + __btd_log_init("*", 0); + /* * Service Search Request * |