diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index e454d86..0f21f48 100644
--- a/tools/btmgmt.c
+++ b/tools/btmgmt.c
void *user_data)
{
if (status != 0) {
- fprintf(stderr,
- "Stop Discovery failed: status 0x%02x (%s)\n",
+ error("Stop Discovery failed: status 0x%02x (%s)",
status, mgmt_errstr(status));
return noninteractive_quit(EXIT_SUCCESS);
}
- printf("Discovery stopped\n");
+ print("Discovery stopped");
discovery = false;
noninteractive_quit(EXIT_SUCCESS);
static void stop_find_usage(void)
{
- printf("Usage: btmgmt stop-find [-l|-b]>\n");
+ print("Usage: btmgmt stop-find [-l|-b]");
}
static struct option stop_find_options[] = {
default:
stop_find_usage();
optind = 0;
- exit(EXIT_SUCCESS);
+ return noninteractive_quit(EXIT_SUCCESS);
}
}
if (mgmt_send(mgmt, MGMT_OP_STOP_DISCOVERY, index, sizeof(cp), &cp,
stop_find_rsp, NULL, NULL) == 0) {
- fprintf(stderr, "Unable to send stop_discovery cmd\n");
- exit(EXIT_FAILURE);
+ error("Unable to send stop_discovery cmd");
+ return noninteractive_quit(EXIT_FAILURE);
}
}