Subject: bin/13962: bin/domainname with corrected style
To: None <gnats-bugs@gnats.netbsd.org>
From: Petri Koistinen <thoron@mb-u07ip065.mbnet.fi>
List: netbsd-bugs
Date: 09/16/2001 01:58:24
>Number:         13962
>Category:       bin
>Synopsis:       bin/domainname with corrected style
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 15 15:58:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Petri Koistinen
>Release:        NetBSD-current Sun Sep 16 01:56:53 EEST 2001
>Organization:
>Environment:
System: NetBSD mb-u07ip065.mbnet.fi 1.5X NetBSD 1.5X (DING-DONG) #1: Sun Sep 16 03:33:42 EEST 2001 thoron@legoland:/usr/src/sys/arch/amiga/compile/DING-DONG amiga
Architecture: m68k
Machine: amiga
>Description:
	Please apply attached patches for bin/domainname
>How-To-Repeat:
>Fix:
Index: domainname.c
===================================================================
RCS file: /cvsroot/basesrc/bin/domainname/domainname.c,v
retrieving revision 1.11
diff -u -r1.11 domainname.c
--- domainname.c	1998/07/28 05:31:24	1.11
+++ domainname.c	2001/09/15 22:54:47
@@ -1,4 +1,4 @@
-/*	$NetBSD: domainname.c,v 1.11 1998/07/28 05:31:24 mycroft Exp $	*/
+/* $NetBSD: domainname.c,v 1.11 1998/07/28 05:31:24 mycroft Exp $ */
 
 /*
  * Copyright (c) 1988, 1993
@@ -55,17 +55,16 @@
 #include <string.h>
 #include <unistd.h>
 
-void usage __P((void));
-int main __P((int, char *[]));
+void usage(void);
+int main(int, char *[]);
 
 int
-main(argc, argv)
-	int argc;
-	char *argv[];
+main(int argc, char *argv[])
 {
 	int ch;
 	char domainname[MAXHOSTNAMELEN];
 
+	setprogname(argv[0]);
 	while ((ch = getopt(argc, argv, "")) != -1)
 		switch (ch) {
 		case '?':
@@ -91,10 +90,10 @@
 }
 
 void
-usage()
+usage(void)
 {
 
-	(void)fprintf(stderr, "usage: domainname [name-of-domain]\n");
+	(void)fprintf(stderr, "usage: %s [name-of-domain]\n", getprogname());
 	exit(1);
 	/* NOTREACHED */
 }
>Release-Note:
>Audit-Trail:
>Unformatted: