diff mbox

[v0,2/3] posix03, posix04: Use '-l' instead of '-i' as option argument name

Message ID 1464858969-23939-3-git-send-email-wagi@monom.org
State New
Headers show

Commit Message

Daniel Wagner June 2, 2016, 9:16 a.m. UTC
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 mbox

Patch

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':