Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/bootp/bootptest usage: Add -f and -m. Use getprogn...



details:   https://anonhg.NetBSD.org/src/rev/90d59e10e52f
branches:  trunk
changeset: 571317:90d59e10e52f
user:      hira <hira%NetBSD.org@localhost>
date:      Wed Nov 17 13:28:31 2004 +0000

description:
usage: Add -f and -m.  Use getprogname().  Print to strerr.
Reviewed by uebayasi@.  This closes PR bin/26535.

diffstat:

 usr.sbin/bootp/bootptest/bootptest.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r d729d7057687 -r 90d59e10e52f usr.sbin/bootp/bootptest/bootptest.c
--- a/usr.sbin/bootp/bootptest/bootptest.c      Wed Nov 17 13:21:09 2004 +0000
+++ b/usr.sbin/bootp/bootptest/bootptest.c      Wed Nov 17 13:28:31 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bootptest.c,v 1.13 2003/07/14 06:08:04 itojun Exp $    */
+/*     $NetBSD: bootptest.c,v 1.14 2004/11/17 13:28:31 hira Exp $      */
 
 /*
  * bootptest.c - Test out a bootp server.
@@ -36,10 +36,11 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: bootptest.c,v 1.13 2003/07/14 06:08:04 itojun Exp $");
+__RCSID("$NetBSD: bootptest.c,v 1.14 2004/11/17 13:28:31 hira Exp $");
 #endif
 
-char *usage = "bootptest [-h] server-name [vendor-data-template-file]";
+char *usage = "usage: %s [-f bootfile] [-h] [-m magic_number] server-name\n"
+             "                 [vendor-data-template-file]\n";
 
 #include <sys/param.h>
 #include <sys/socket.h>
@@ -196,7 +197,7 @@
 
                error:
                default:
-                       puts(usage);
+                       (void)fprintf(stderr, usage, getprogname());
                        exit(1);
 
                }
@@ -218,7 +219,7 @@
        }
        if (!servername) {
                printf("missing server name.\n");
-               puts(usage);
+               (void)fprintf(stderr, usage, getprogname());
                exit(1);
        }
        /*



Home | Main Index | Thread Index | Old Index