#include <signal.h>
#include <poll.h>
#include <errno.h>
+#include "utils.h"
#define TRACEPOINT_DEFINE
#include "tp.h"
char text[10] = "test";
double dbl = 2.0;
float flt = 2222.0;
- int nr_iter = 100;
+ int nr_iter = 100, ret = 0;
useconds_t nr_usec = 0;
char *after_first_event_file_path = NULL;
char *before_last_event_file_path = NULL;
* that at least one tracepoint has been hit.
*/
create_file(after_first_event_file_path);
- usleep(nr_usec);
+ if (nr_usec) {
+ if (usleep_safe(nr_usec)) {
+ ret = -1;
+ goto end;
+ }
+ }
}
- return 0;
+end:
+ exit(!ret ? EXIT_SUCCESS : EXIT_FAILURE);
}