projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tests: Switch test apps to use usleep_safe()
[lttng-tools.git]
/
tests
/
utils
/
testapp
/
gen-ust-nevents
/
gen-ust-nevents.c
diff --git
a/tests/utils/testapp/gen-ust-nevents/gen-ust-nevents.c
b/tests/utils/testapp/gen-ust-nevents/gen-ust-nevents.c
index 9e5a1d1f287871f32af22e3f9f943feba471236b..9d9f171b4616425b99116088306dedb9d16d7990 100644
(file)
--- a/
tests/utils/testapp/gen-ust-nevents/gen-ust-nevents.c
+++ b/
tests/utils/testapp/gen-ust-nevents/gen-ust-nevents.c
@@
-25,13
+25,14
@@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
+#include "utils.h"
#define TRACEPOINT_DEFINE
#include "tp.h"
int main(int argc, char **argv)
{
#define TRACEPOINT_DEFINE
#include "tp.h"
int main(int argc, char **argv)
{
- int i, netint;
+ int i, netint
, ret = 0
;
long values[] = { 1, 2, 3 };
char text[10] = "test";
double dbl = 2.0;
long values[] = { 1, 2, 3 };
char text[10] = "test";
double dbl = 2.0;
@@
-60,8
+61,14
@@
int main(int argc, char **argv)
dbl, flt);
tracepoint(tp, tptest5, i, netint, values, text, strlen(text),
dbl, flt);
dbl, flt);
tracepoint(tp, tptest5, i, netint, values, text, strlen(text),
dbl, flt);
- usleep(nr_usec);
+ if (nr_usec) {
+ if (usleep_safe(nr_usec)) {
+ ret = -1;
+ goto end;
+ }
+ }
}
}
- return 0;
+end:
+ exit(!ret ? EXIT_SUCCESS : EXIT_FAILURE);
}
}
This page took
0.025175 seconds
and
5
git commands to generate.