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.
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;
}
#include <config.h>
#endif
+#include <errno.h>
#include <stdbool.h>
#include <bluetooth/bluetooth.h>
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;
}
/*