Rename the helper to show that it outputs a string, and not an error DbusMessage as the other functions do. --- src/device.c | 10 +++++----- src/error.c | 4 ++-- src/error.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/device.c b/src/device.c index e4d5d79ee18b..709052d301b7 100644 --- a/src/device.c +++ b/src/device.c @@ -2341,7 +2341,7 @@ done: g_dbus_send_message(dbus_conn, btd_error_failed(dev->connect, - btd_error_bredr_conn_from_errno(err))); + btd_error_str_bredr_conn_from_errno(err))); } else { /* Start passive SDP discovery to update known services */ if (dev->bredr && !dev->svc_refreshed && dev->refresh_discovery) @@ -2699,7 +2699,7 @@ static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type if (err == -EALREADY) return dbus_message_new_method_return(msg); return btd_error_failed(msg, - btd_error_bredr_conn_from_errno(err)); + btd_error_str_bredr_conn_from_errno(err)); } dev->connect = dbus_message_ref(msg); @@ -3004,8 +3004,8 @@ static void browse_request_complete(struct browse_req *req, uint8_t type, } reply = btd_error_failed(req->msg, bdaddr_type == BDADDR_BREDR ? - btd_error_bredr_conn_from_errno(err) : - btd_error_le_conn_from_errno(err)); + btd_error_str_bredr_conn_from_errno(err) : + btd_error_str_le_conn_from_errno(err)); goto done; } @@ -6283,7 +6283,7 @@ done: if (device->connect) { if (err < 0) reply = btd_error_failed(device->connect, - btd_error_le_conn_from_errno(err)); + btd_error_str_le_conn_from_errno(err)); else reply = dbus_message_new_method_return(device->connect); diff --git a/src/error.c b/src/error.c index f179e6cda0e8..d82c2f2e1520 100644 --- a/src/error.c +++ b/src/error.c @@ -134,7 +134,7 @@ DBusMessage *btd_error_failed(DBusMessage *msg, const char *str) ".Failed", "%s", str); } -const char *btd_error_bredr_conn_from_errno(int errno_code) +const char *btd_error_str_bredr_conn_from_errno(int errno_code) { switch (-errno_code) { case EALREADY: @@ -178,7 +178,7 @@ const char *btd_error_bredr_conn_from_errno(int errno_code) } } -const char *btd_error_le_conn_from_errno(int errno_code) +const char *btd_error_str_le_conn_from_errno(int errno_code) { switch (-errno_code) { case EINVAL: diff --git a/src/error.h b/src/error.h index 83206cb48a66..5b49400fbb92 100644 --- a/src/error.h +++ b/src/error.h @@ -87,5 +87,5 @@ DBusMessage *btd_error_not_ready(DBusMessage *msg); DBusMessage *btd_error_not_ready_str(DBusMessage *msg, const char *str); DBusMessage *btd_error_failed(DBusMessage *msg, const char *str); -const char *btd_error_bredr_conn_from_errno(int errno_code); -const char *btd_error_le_conn_from_errno(int errno_code); +const char *btd_error_str_bredr_conn_from_errno(int errno_code); +const char *btd_error_str_le_conn_from_errno(int errno_code); -- 2.50.0