X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Futils%2Ftestapp%2Fgen-ust-tracef%2Fgen-ust-tracef.c;h=8f74a90daf45728d0bd2f24cb17a8e6ddcce5224;hp=1c3493dba3c003c86094ab6d009278ec67d89909;hb=6c64187973c605e3992eba5c638859dfb247190a;hpb=b02dcdb88f016e831400e6b2a86130035197e1eb diff --git a/tests/utils/testapp/gen-ust-tracef/gen-ust-tracef.c b/tests/utils/testapp/gen-ust-tracef/gen-ust-tracef.c index 1c3493dba..8f74a90da 100644 --- a/tests/utils/testapp/gen-ust-tracef/gen-ust-tracef.c +++ b/tests/utils/testapp/gen-ust-tracef/gen-ust-tracef.c @@ -1,21 +1,12 @@ /* - * Copyright (C) - 2012 David Goulet - * Copyright (C) - 2014 Mathieu Desnoyers + * Copyright (C) 2012 David Goulet + * Copyright (C) 2014 Mathieu Desnoyers * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; version 2.1 of the License. + * SPDX-License-Identifier: LGPL-2.1-only * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#define _LGPL_SOURCE #include #include #include @@ -28,9 +19,11 @@ #include #include +#include "signal-helper.h" const char *str = "test string"; +static void create_file(const char *path) { int ret; @@ -53,6 +46,10 @@ int main(int argc, char **argv) useconds_t nr_usec = 0; char *tmp_file_path = NULL; + if (set_signal_handler()) { + return 1; + } + if (argc >= 2) { nr_iter = atoi(argv[1]); } @@ -77,6 +74,9 @@ int main(int argc, char **argv) create_file(tmp_file_path); } usleep(nr_usec); + if (should_quit) { + break; + } } return 0;