improve error handling

This commit is contained in:
Wim Taymans 2019-06-07 17:50:46 +02:00
parent 8cda0dd962
commit b2992a0f8a
2 changed files with 7 additions and 3 deletions

View file

@ -1708,6 +1708,10 @@ static DBusHandlerResult profile_new_connection(DBusConnection *conn, DBusMessag
asprintf(&pathfd, "%s/fd%d", path, fd);
t = transport_create(monitor, pathfd, sizeof(struct transport_data));
if (t == NULL) {
spa_log_warn(monitor->log, "can't create transport: %m");
return DBUS_HANDLER_RESULT_NEED_MEMORY;
}
spa_bt_transport_set_implementation(t, &sco_transport_impl, t);
t->device = d;
@ -1940,7 +1944,7 @@ static void interface_added(struct spa_bt_monitor *monitor,
if (a == NULL) {
a = adapter_create(monitor, object_path);
if (a == NULL) {
spa_log_warn(monitor->log, "can't create adapter");
spa_log_warn(monitor->log, "can't create adapter: %m");
return;
}
}
@ -1960,7 +1964,7 @@ static void interface_added(struct spa_bt_monitor *monitor,
if (d == NULL) {
d = device_create(monitor, object_path);
if (d == NULL) {
spa_log_warn(monitor->log, "can't create device");
spa_log_warn(monitor->log, "can't create device: %m");
return;
}
}

View file

@ -469,7 +469,7 @@ static void idle_func(struct spa_source *source)
}
if ((r = pw_rtkit_make_realtime(system_bus, 0, rtprio)) < 0) {
pw_log_debug("could not make thread realtime: %s", strerror(r));
pw_log_debug("could not make thread realtime: %s", spa_strerror(r));
} else {
pw_log_debug("thread made realtime");
}