diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2016-07-25 12:58:44 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2017-03-10 10:36:46 -0500 |
commit | ed8ad3faf201cbaa718da9f95d17b850ca5e553f (patch) | |
tree | e9c2fb758626c34f2d6f81c222975abbb6b82451 | |
parent | 7e2cfc39e4014d0465d52dfb7eaf0c2b20aba13b (diff) |
release_ts: improve argument handling
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | bin/release_ts.c | 5 |
2 files changed, 4 insertions, 3 deletions
@@ -218,7 +218,7 @@ lib-rtspin = -lrt | |||
218 | obj-uncache = uncache.o | 218 | obj-uncache = uncache.o |
219 | lib-uncache = -lrt | 219 | lib-uncache = -lrt |
220 | 220 | ||
221 | obj-release_ts = release_ts.o | 221 | obj-release_ts = release_ts.o common.o |
222 | 222 | ||
223 | obj-measure_syscall = null_call.o | 223 | obj-measure_syscall = null_call.o |
224 | lib-measure_syscall = -lm | 224 | lib-measure_syscall = -lm |
diff --git a/bin/release_ts.c b/bin/release_ts.c index 661099e..4c96232 100644 --- a/bin/release_ts.c +++ b/bin/release_ts.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <sys/stat.h> | 6 | #include <sys/stat.h> |
7 | #include <fcntl.h> | 7 | #include <fcntl.h> |
8 | 8 | ||
9 | #include "common.h" | ||
9 | #include "litmus.h" | 10 | #include "litmus.h" |
10 | #include "internal.h" | 11 | #include "internal.h" |
11 | 12 | ||
@@ -53,7 +54,7 @@ int main(int argc, char** argv) | |||
53 | while ((opt = getopt(argc, argv, OPTSTR)) != -1) { | 54 | while ((opt = getopt(argc, argv, OPTSTR)) != -1) { |
54 | switch (opt) { | 55 | switch (opt) { |
55 | case 'd': | 56 | case 'd': |
56 | delay = ms2ns(atoi(optarg)); | 57 | delay = ms2ns(want_non_negative_double(optarg, "-d")); |
57 | break; | 58 | break; |
58 | case 'w': | 59 | case 'w': |
59 | wait = 1; | 60 | wait = 1; |
@@ -64,7 +65,7 @@ int main(int argc, char** argv) | |||
64 | break; | 65 | break; |
65 | case 'f': | 66 | case 'f': |
66 | wait = 1; | 67 | wait = 1; |
67 | expected = atoi(optarg); | 68 | expected = want_non_negative_int(optarg, "-f"); |
68 | break; | 69 | break; |
69 | case ':': | 70 | case ':': |
70 | usage("Argument missing."); | 71 | usage("Argument missing."); |