Tests: cleanly exit from test apps on reception of SIGTERM
[lttng-tools.git] / tests / utils / testapp / gen-ust-nevents-str / gen-ust-nevents-str.c
index 6d90bfc66524c49cf961e7e624538d0e53905cbc..904991a4d40cf055cfa8340c3d718c9854091a2e 100644 (file)
@@ -17,6 +17,7 @@
 
 #define _LGPL_SOURCE
 #include <stdio.h>
+#include "signal-helper.h"
 
 #define TRACEPOINT_DEFINE
 #include "tp.h"
@@ -27,6 +28,10 @@ int main(int argc, char **argv)
        int i;
        int arg_i;
 
+       if (set_signal_handler()) {
+               return 1;
+       }
+
        if (argc <= 3) {
                fprintf(stderr, "Usage: %s COUNT STRING [STRING]...\n",
                        argv[0]);
@@ -48,6 +53,9 @@ int main(int argc, char **argv)
                if (arg_i == argc) {
                        arg_i = 2;
                }
+               if (should_quit) {
+                       break;
+               }
        }
 
        return 0;
This page took 0.024815 seconds and 5 git commands to generate.