diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2018-07-24 08:35:27 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-07-24 08:35:27 -0700 |
commit | 08fa34b1e2095559a024af6d2beeac8a8a3e6311 (patch) | |
tree | 3f9ae71e04cc9a389f8b406ede4daddc69808094 /qahw_api | |
parent | 5b1ef2759e3c65c77aafc57fb4e6284fa7e7a676 (diff) | |
parent | e4527e1a01e9deeed69943b34dc1c501ba56a788 (diff) | |
download | android_hardware_qcom_audio-08fa34b1e2095559a024af6d2beeac8a8a3e6311.tar.gz android_hardware_qcom_audio-08fa34b1e2095559a024af6d2beeac8a8a3e6311.tar.bz2 android_hardware_qcom_audio-08fa34b1e2095559a024af6d2beeac8a8a3e6311.zip |
Merge "qahw_api: test: Handle SIGTERM signal in test app"
Diffstat (limited to 'qahw_api')
-rw-r--r-- | qahw_api/test/qahw_multi_record_test.c | 6 | ||||
-rw-r--r-- | qahw_api/test/qahw_playback_test.c | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/qahw_api/test/qahw_multi_record_test.c b/qahw_api/test/qahw_multi_record_test.c index 87626171..89b581e5 100644 --- a/qahw_api/test/qahw_multi_record_test.c +++ b/qahw_api/test/qahw_multi_record_test.c @@ -846,7 +846,11 @@ int main(int argc, char* argv[]) { /* Register the SIGINT to close the App properly */ if (signal(SIGINT, stop_signal_handler) == SIG_ERR) - fprintf(log_file, "Failed to register SIGINT:%d\n",errno); + fprintf(log_file, "Failed to register SIGINT:%d\n", errno); + + /* Register the SIGTERM to close the App properly */ + if (signal(SIGTERM, stop_signal_handler) == SIG_ERR) + fprintf(log_file, "Failed to register SIGTERM:%d\n", errno); for (i = 0; i < MAX_RECORD_SESSIONS; i++) { if (thread_active[i] == 1) { diff --git a/qahw_api/test/qahw_playback_test.c b/qahw_api/test/qahw_playback_test.c index 3ce01ef9..88342526 100644 --- a/qahw_api/test/qahw_playback_test.c +++ b/qahw_api/test/qahw_playback_test.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. * Not a Contribution. * * Copyright (C) 2015 The Android Open Source Project * @@ -2403,8 +2403,14 @@ int main(int argc, char* argv[]) { /* Register the SIGINT to close the App properly */ if (signal(SIGINT, stop_signal_handler) == SIG_ERR) { - fprintf(log_file, "Failed to register SIGINT:%d\n",errno); - fprintf(stderr, "Failed to register SIGINT:%d\n",errno); + fprintf(log_file, "Failed to register SIGINT:%d\n", errno); + fprintf(stderr, "Failed to register SIGINT:%d\n", errno); + } + + /* Register the SIGTERM to close the App properly */ + if (signal(SIGTERM, stop_signal_handler) == SIG_ERR) { + fprintf(log_file, "Failed to register SIGTERM:%d\n", errno); + fprintf(stderr, "Failed to register SIGTERM:%d\n", errno); } /* Check for Dual main content */ |