public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cyclictest: exit with an error code in error case
@ 2009-07-13 12:32 Sebastian Andrzej Siewior
  2009-07-13 17:37 ` Clark Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2009-07-13 12:32 UTC (permalink / raw)
  To: Clark Williams; +Cc: linux-rt-users

if cyclictest is started with invalid arguments or $SOMETHING, then it
prints the help screen and the exit code is 0 which is wrong.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 src/cyclictest/cyclictest.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index bfb8aa9..e1c9e0e 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -746,7 +746,7 @@ out:
 
 
 /* Print usage information */
-static void display_help(void)
+static void display_help(int error)
 {
 	char tracers[MAX_PATH];
 
@@ -805,6 +805,8 @@ static void display_help(void)
                "                           format: --policy=fifo(default) or --policy=rr\n",
 	       tracers
 		);
+	if (error)
+		exit(-1);
 	exit(0);
 }
 
@@ -977,7 +979,7 @@ static void process_options (int argc, char *argv[])
                 case 'w': tracetype = WAKEUP; break;
                 case 'W': tracetype = WAKEUPRT; break;
                 case 'y': handlepolicy(optarg); break;
-		case '?': error = 1; break;
+		case '?': display_help(0); break;
 		}
 	}
 
@@ -1028,7 +1030,7 @@ static void process_options (int argc, char *argv[])
 
 
 	if (error)
-		display_help ();
+		display_help(1);
 }
 
 static int check_kernel(void)
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cyclictest: exit with an error code in error case
  2009-07-13 12:32 [PATCH] cyclictest: exit with an error code in error case Sebastian Andrzej Siewior
@ 2009-07-13 17:37 ` Clark Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Clark Williams @ 2009-07-13 17:37 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: linux-rt-users

[-- Attachment #1: Type: text/plain, Size: 456 bytes --]

On Mon, 13 Jul 2009 14:32:09 +0200
Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:

> if cyclictest is started with invalid arguments or $SOMETHING, then it
> prints the help screen and the exit code is 0 which is wrong.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  src/cyclictest/cyclictest.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 

Thanks, merged and pushed in 0.49

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-13 17:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-13 12:32 [PATCH] cyclictest: exit with an error code in error case Sebastian Andrzej Siewior
2009-07-13 17:37 ` Clark Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox