Messages in this thread Patch in this message | | | From | Daniel Wagner <> | Subject | [PATCH v0 2/3] posix03, posix04: Use '-l' instead of '-i' as option argument name | Date | Thu, 22 Sep 2016 10:46:06 +0200 |
| |
From: Daniel Wagner <daniel.wagner@bmw-carit.de>
All other test use '=l' instead of '-i' to as option name for defining how many loops should be executed. Let's streamline posix03 and posix04.
Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de> --- posix03.c | 6 +++--- posix04.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/posix03.c b/posix03.c index 864f0f0..a36caa5 100644 --- a/posix03.c +++ b/posix03.c @@ -109,7 +109,7 @@ static int do_child(int lockfd, int i, int to_lockers, int from_lockers) static int usage(char *argv0) { - errx(1, "Usage: %s [-i iterations] [-n nr_children] <filename>", argv0); + errx(1, "Usage: %s [-n nr_procs] [-l nr_loops] <filename>", argv0); } int main(int argc, char *argv[]) @@ -126,9 +126,9 @@ int main(int argc, char *argv[]) total.tv_sec = 0; total.tv_nsec = 0; - while ((opt = getopt(argc, argv, "i:n:")) != -1) { + while ((opt = getopt(argc, argv, "l:n:")) != -1) { switch (opt) { - case 'i': + case 'l': iter = atoi(optarg); break; case 'n': diff --git a/posix04.c b/posix04.c index ed862f2..67eb4af 100644 --- a/posix04.c +++ b/posix04.c @@ -158,7 +158,7 @@ static int do_child(int fd, int id, int nproc, int to_lockers, int from_lockers) static int usage(char *argv0) { - errx(1, "Usage: %s [-i iterations] [-n nr_children] [-s] <filename>", argv0); + errx(1, "Usage: %s [-n nr_procs] [-l nr_loops] [-s] <filename>", argv0); } int main(int argc, char *argv[]) @@ -175,9 +175,9 @@ int main(int argc, char *argv[]) total.tv_sec = 0; total.tv_nsec = 0; - while ((opt = getopt(argc, argv, "i:n:s")) != -1) { + while ((opt = getopt(argc, argv, "l:n:s")) != -1) { switch (opt) { - case 'i': + case 'l': iter = atoi(optarg); break; case 'n': -- 2.5.5
| |