diff --git a/profiles/network/bnep.c b/profiles/network/bnep.c
index 035beb1..e17a130 100644
--- a/profiles/network/bnep.c
+++ b/profiles/network/bnep.c
if (err == -EPROTONOSUPPORT)
warn("kernel lacks bnep-protocol support");
else
- error("Failed to open control socket: %s (%d)",
+ error("bnep: Failed to open control socket: %s (%d)",
strerror(-err), -err);
return err;
req.flags = 0;
if (ioctl(ctl, BNEPCONNDEL, &req)) {
int err = -errno;
- error("Failed to kill connection: %s (%d)",
+ error("bnep: Failed to kill connection: %s (%d)",
strerror(-err), -err);
return err;
}
req.role = role;
if (ioctl(ctl, BNEPCONNADD, &req) < 0) {
int err = -errno;
- error("Failed to add device %s: %s(%d)",
+ error("bnep: Failed to add device %s: %s(%d)",
dev, strerror(-err), -err);
return err;
}
close(sk);
if (err < 0) {
- error("Could not bring up %s", devname);
+ error("bnep: Could not bring up %s", devname);
return err;
}
close(sk);
if (err < 0) {
- error("Could not bring down %s", devname);
+ error("bnep: Could not bring down %s", devname);
return err;
}
}
if (cond & (G_IO_HUP | G_IO_ERR)) {
- error("Hangup or error on l2cap server socket");
+ error("bnep: Hangup or error on l2cap server socket");
goto failed;
}
memset(pkt, 0, BNEP_MTU);
r = read(sk, pkt, sizeof(pkt) - 1);
if (r < 0) {
- error("IO Channel read error");
+ error("bnep: IO Channel read error");
goto failed;
}
if (r == 0) {
- error("No packet received on l2cap socket");
+ error("bnep: No packet received on l2cap socket");
goto failed;
}
errno = EPROTO;
if ((size_t) r < sizeof(*rsp)) {
- error("Packet received is not bnep type");
+ error("bnep: Packet received is not bnep type");
goto failed;
}
rsp = (void *) pkt;
if (rsp->type != BNEP_CONTROL) {
- error("Packet received is not bnep type");
+ error("bnep: Packet received is not bnep type");
goto failed;
}
r = ntohs(rsp->resp);
if (r != BNEP_SUCCESS) {
- error("bnep failed");
+ error("bnep: failed");
goto failed;
}
goto failed;
if (bnep_if_up(session->iface)) {
- error("could not up %s", session->iface);
+ error("bnep: could not up %s", session->iface);
bnep_conndel(&session->dst_addr);
goto failed;
}
fd = g_io_channel_unix_get_fd(session->io);
if (write(fd, pkt, sizeof(*req) + sizeof(*s)) < 0) {
- error("bnep connection req send failed: %s", strerror(errno));
+ error("bnep: connection req send failed: %s", strerror(errno));
return -errno;
}
struct bnep *session = user_data;
if (session->attempts == CON_SETUP_RETRIES) {
- error("Too many bnep connection attempts");
+ error("bnep: Too many bnep connection attempts");
} else {
- error("bnep connection setup TO, retrying...");
+ error("bnep: connection setup TO, retrying...");
if (bnep_setup_conn_req(session) == 0)
return TRUE;
}
bt_io_get(session->io, &gerr, BT_IO_OPT_DEST_BDADDR, &session->dst_addr,
BT_IO_OPT_INVALID);
if (gerr) {
- error("%s", gerr->message);
+ error("bnep: connect failed: %s", gerr->message);
g_error_free(gerr);
return -EINVAL;
}
return err;
if (bnep_add_to_bridge(iface, bridge) < 0) {
- error("Can't add %s to the bridge %s: %s(%d)",
+ error("bnep: Can't add %s to the bridge %s: %s(%d)",
iface, bridge, strerror(errno), errno);
bnep_conndel(addr);
return -errno;
}
if (bnep_if_up(iface) < 0) {
- error("Can't up the interface %s: %s(%d)",
+ error("bnep: Can't up the interface %s: %s(%d)",
iface, strerror(errno), errno);
return -errno;
}