Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1488653

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

From Daniel Wagner <wagi@monom.org>
Newsgroups linux.kernel
Subject [PATCH v0 2/3] posix03, posix04: Use '-l' instead of '-i' as option argument name
Date 2016-09-22 10:50 +0200
Message-ID <sk7RE-42c-23@gated-at.bofh.it> (permalink)
References <sk7RD-42c-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v0 0/3] [RESEND] lockperf: a few small improvments Daniel Wagner <wagi@monom.org> - 2016-09-22 10:50 +0200
  [PATCH v0 2/3] posix03, posix04: Use '-l' instead of '-i' as option argument name Daniel Wagner <wagi@monom.org> - 2016-09-22 10:50 +0200
  [PATCH v0 3/3] posix03: Do not kill everything in the process group Daniel Wagner <wagi@monom.org> - 2016-09-22 10:50 +0200
  [PATCH v0 1/3] Synchronize all clients on start up Daniel Wagner <wagi@monom.org> - 2016-09-22 10:50 +0200

csiph-web