Diff between 7d59391bb783c60f15803f97860094a6817894b2 and 5499681bc63226c03984e3493eebd0dc4cd2243f

Changed Files

File Additions Deletions Status
client/advertising.c +2 -7 modified
client/main.c +2 -1 modified

Full Patch

diff --git a/client/advertising.c b/client/advertising.c
index 382ae42..f9df1b8 100644
--- a/client/advertising.c
+++ b/client/advertising.c
@@ -18,6 +18,7 @@
 #include <stdint.h>
 #include <stdbool.h>
 #include <string.h>
+#include <errno.h>
 
 #include "gdbus/gdbus.h"
 #include "src/shared/util.h"
@@ -238,7 +239,7 @@ static void register_reply(DBusMessage *message, void *user_data)
 		ad.registered = true;
 		bt_shell_printf("Advertising object registered\n");
 		print_ad();
-		/* Leave advertise running even on noninteractive mode */
+		return bt_shell_noninteractive_quit(-EINPROGRESS);
 	} else {
 		bt_shell_printf("Failed to register advertisement: %s\n", error.name);
 		dbus_error_free(&error);
@@ -874,8 +875,6 @@ static void ad_clear_service(int type)
 {
 	g_free(ad.service[type].uuid);
 	memset(&ad.service[type], 0, sizeof(ad.service[type]));
-
-	return bt_shell_noninteractive_quit(EXIT_SUCCESS);
 }
 
 static bool ad_add_data(struct ad_data *data, int argc, char *argv[])
@@ -950,8 +949,6 @@ void ad_disable_service(DBusConnection *conn, int type)
 static void ad_clear_manufacturer(int type)
 {
 	memset(&ad.manufacturer[type], 0, sizeof(ad.manufacturer[type]));
-
-	return bt_shell_noninteractive_quit(EXIT_SUCCESS);
 }
 
 void ad_advertise_manufacturer(DBusConnection *conn, int type,
@@ -1006,8 +1003,6 @@ void ad_disable_manufacturer(DBusConnection *conn, int type)
 static void ad_clear_data(int type)
 {
 	memset(&ad.data[type], 0, sizeof(ad.data[type]));
-
-	return bt_shell_noninteractive_quit(EXIT_SUCCESS);
 }
 
 void ad_advertise_data(DBusConnection *conn, int type, int argc, char *argv[])
diff --git a/client/main.c b/client/main.c
index c232195..d99a515 100644
--- a/client/main.c
+++ b/client/main.c
@@ -1219,7 +1219,8 @@ static void start_discovery_reply(DBusMessage *message, void *user_data)
 	bt_shell_printf("Discovery %s\n", enable ? "started" : "stopped");
 
 	filter.active = enable;
-	/* Leave the discovery running even on noninteractive mode */
+
+	return bt_shell_noninteractive_quit(-EINPROGRESS);
 }
 
 static void clear_discovery_filter(DBusMessageIter *iter, void *user_data)