From: David Herrmann Date: Wed, 2 Oct 2013 15:57:31 +0000 (+0200) Subject: bnep: improve error-msg if bnep.ko is not loaded X-Git-Tag: android-x86-4.4-r3~7542 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7c6ab2ca3ec3eb2c8536eb71783d7db55dda9ec2;p=android-x86%2Fexternal-bluetooth-bluez.git bnep: improve error-msg if bnep.ko is not loaded bnep.ko, besides others, can be disabled in custom kernels if network-support is not required. To avoid strange error messages, handle EPROTONOSUPPORT as a special case and emit a warning that kernel support is missing. --- diff --git a/profiles/network/common.c b/profiles/network/common.c index e069892ea..0b291bdb3 100644 --- a/profiles/network/common.c +++ b/profiles/network/common.c @@ -110,8 +110,13 @@ int bnep_init(void) if (ctl < 0) { int err = -errno; - error("Failed to open control socket: %s (%d)", + + if (err == -EPROTONOSUPPORT) + warn("kernel lacks bnep-protocol support"); + else + error("Failed to open control socket: %s (%d)", strerror(-err), -err); + return err; } diff --git a/profiles/network/manager.c b/profiles/network/manager.c index 03b1b3dd8..ab4224ded 100644 --- a/profiles/network/manager.c +++ b/profiles/network/manager.c @@ -25,6 +25,7 @@ #include #endif +#include #include #include @@ -169,11 +170,15 @@ static struct btd_profile nap_profile = { static int network_init(void) { + int err; + read_config(CONFIGDIR "/network.conf"); - if (bnep_init()) { - error("Can't init bnep module"); - return -1; + err = bnep_init(); + if (err) { + if (err == -EPROTONOSUPPORT) + err = -ENOSYS; + return err; } /*