[PATCH 4/8] agetty: error message about required arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch also fixes only remaining magical number to EXIT_*
markup.

Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 term-utils/agetty.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 9eda573..b6b26fd 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -479,8 +479,10 @@ parse_args(argc, argv, op)
 	}
     }
 	debug("after getopt loop\n");
-    if (argc < optind + 2)			/* check parameter count */
-	usage();
+    if (argc < optind + 2) {			/* check parameter count */
+	warnx(_("not enough arguments"));
+	usage(stderr);
+    }
 
     /* we loosen up a bit and accept both "baudrate tty" and "tty baudrate" */
     if('0' <= argv[optind][0] && argv[optind][0] <= '9') {
@@ -1340,5 +1342,5 @@ error(const char *fmt, ...) {
     }
 #endif
     (void) sleep((unsigned) 10);		/* be kind to init(8) */
-    exit(1);
+    exit(EXIT_FAILURE);
 }
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux