summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2015-05-13 17:01:10 +0200
committerSzymon Janc <szymon.janc@tieto.com>2015-05-13 17:02:47 +0200
commitf020f5f1c0be28249fc7ad3d32729dfee01e0691 (patch)
treeec066a9ac0549bca9b680016371616b95a1b2507 /android
parent9c578df02391dbc34d61ac8fc03fc9116a3187cf (diff)
downloadbluez-f020f5f1c0be28249fc7ad3d32729dfee01e0691.tar.gz
android/avdtptest: Return error code when exiting on failure
Should improve scripting support.
Diffstat (limited to 'android')
-rw-r--r--android/avdtptest.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/android/avdtptest.c b/android/avdtptest.c
index 2e07d7ec3..01d52eae7 100644
--- a/android/avdtptest.c
+++ b/android/avdtptest.c
@@ -826,13 +826,13 @@ int main(int argc, char *argv[])
dev_role = AVDTP_SEP_TYPE_SINK;
} else {
usage();
- exit(0);
+ exit(1);
}
break;
case 'c':
if (str2ba(optarg, &dst) < 0) {
usage();
- exit(0);
+ exit(1);
}
break;
case 'l':
@@ -855,28 +855,30 @@ int main(int argc, char *argv[])
if (version != 0x0100 && version != 0x0102 &&
version != 0x0103) {
printf("invalid version\n");
- exit(0);
+ exit(1);
}
break;
case 'h':
- default:
usage();
exit(0);
+ default:
+ usage();
+ exit(1);
}
}
lseps = queue_new();
if (!lseps) {
printf("Failed to allocate memory\n");
- exit(0);
+ exit(1);
}
local_sep = avdtp_register_sep(lseps, dev_role, AVDTP_MEDIA_TYPE_AUDIO,
0x00, TRUE, &sep_ind, &sep_cfm, NULL);
if (!local_sep) {
printf("Failed to register sep\n");
- exit(0);
+ exit(1);
}
queue_push_tail(lseps, local_sep);
@@ -892,7 +894,7 @@ int main(int argc, char *argv[])
if (!io) {
printf("Failed: %s\n", err->message);
g_error_free(err);
- exit(0);
+ exit(1);
}
g_main_loop_run(mainloop);