[PATCH bluez] client: Add missing line breaks in logged messages

Rafał Miłecki zajec5 at gmail.com
Mon Aug 19 11:35:46 UTC 2019


From: Rafał Miłecki <rafal at milecki.pl>

bt_shell_printf() requires passing format with a line break at its end

Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
 client/gatt.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/client/gatt.c b/client/gatt.c
index e03ef9679..2b8dfbe29 100644
--- a/client/gatt.c
+++ b/client/gatt.c
@@ -740,7 +740,7 @@ static int sock_send(struct io *io, struct iovec *iov, size_t iovlen)
 	ret = sendmsg(io_get_fd(io), &msg, MSG_NOSIGNAL);
 	if (ret < 0) {
 		ret = -errno;
-		bt_shell_printf("sendmsg: %s", strerror(-ret));
+		bt_shell_printf("sendmsg: %s\n", strerror(-ret));
 	}
 
 	return ret;
@@ -755,7 +755,8 @@ static void write_attribute(GDBusProxy *proxy,
 		bt_shell_printf("Attempting to write fd %d\n",
 						io_get_fd(write_io.io));
 		if (sock_send(write_io.io, &data->iov, 1) < 0) {
-			bt_shell_printf("Failed to write: %s", strerror(errno));
+			bt_shell_printf("Failed to write: %s\n",
+					strerror(errno));
 			return bt_shell_noninteractive_quit(EXIT_FAILURE);
 		}
 		return;
@@ -852,7 +853,7 @@ static bool sock_read(struct io *io, void *user_data)
 
 	bytes_read = recvmsg(fd, &msg, MSG_DONTWAIT);
 	if (bytes_read < 0) {
-		bt_shell_printf("recvmsg: %s", strerror(errno));
+		bt_shell_printf("recvmsg: %s\n", strerror(errno));
 		return false;
 	}
 
@@ -2154,7 +2155,7 @@ static void authorize_write_response(const char *input, void *user_data)
 		goto error;
 	}
 
-	bt_shell_printf("[" COLORED_CHG "] Attribute %s (%s) written",
+	bt_shell_printf("[" COLORED_CHG "] Attribute %s (%s) written\n",
 			chrc->path, bt_uuidstr_to_str(chrc->uuid));
 
 	g_dbus_emit_property_changed(aad->conn, chrc->path, CHRC_INTERFACE,
@@ -2278,7 +2279,7 @@ static DBusMessage *chrc_write_value(DBusConnection *conn, DBusMessage *msg,
 		return g_dbus_create_error(msg,
 				"org.bluez.Error.InvalidValueLength", NULL);
 
-	bt_shell_printf("[" COLORED_CHG "] Attribute %s (%s) written",
+	bt_shell_printf("[" COLORED_CHG "] Attribute %s (%s) written\n",
 			chrc->path, bt_uuidstr_to_str(chrc->uuid));
 
 	g_dbus_emit_property_changed(conn, chrc->path, CHRC_INTERFACE, "Value");
@@ -2466,7 +2467,7 @@ static DBusMessage *chrc_start_notify(DBusConnection *conn, DBusMessage *msg,
 
 	chrc->notifying = true;
 	bt_shell_printf("[" COLORED_CHG "] Attribute %s (%s) notifications "
-			"enabled", chrc->path, bt_uuidstr_to_str(chrc->uuid));
+			"enabled\n", chrc->path, bt_uuidstr_to_str(chrc->uuid));
 	g_dbus_emit_property_changed(conn, chrc->path, CHRC_INTERFACE,
 							"Notifying");
 
@@ -2486,7 +2487,8 @@ static DBusMessage *chrc_stop_notify(DBusConnection *conn, DBusMessage *msg,
 
 	chrc->notifying = false;
 	bt_shell_printf("[" COLORED_CHG "] Attribute %s (%s) notifications "
-			"disabled", chrc->path, bt_uuidstr_to_str(chrc->uuid));
+			"disabled\n", chrc->path,
+			bt_uuidstr_to_str(chrc->uuid));
 	g_dbus_emit_property_changed(conn, chrc->path, CHRC_INTERFACE,
 							"Notifying");
 
@@ -2498,7 +2500,7 @@ static DBusMessage *chrc_confirm(DBusConnection *conn, DBusMessage *msg,
 {
 	struct chrc *chrc = user_data;
 
-	bt_shell_printf("Attribute %s (%s) indication confirm received",
+	bt_shell_printf("Attribute %s (%s) indication confirm received\n",
 			chrc->path, bt_uuidstr_to_str(chrc->uuid));
 
 	return dbus_message_new_method_return(msg);
@@ -2689,7 +2691,7 @@ static DBusMessage *desc_write_value(DBusConnection *conn, DBusMessage *msg,
 			desc->path, bt_uuidstr_to_str(desc->uuid),
 			path_to_address(device), offset, link);
 
-	bt_shell_printf("[" COLORED_CHG "] Attribute %s (%s) written",
+	bt_shell_printf("[" COLORED_CHG "] Attribute %s (%s) written\n",
 			desc->path, bt_uuidstr_to_str(desc->uuid));
 
 	g_dbus_emit_property_changed(conn, desc->path, CHRC_INTERFACE, "Value");
-- 
2.21.0



More information about the dbus mailing list