Subject: bin/4076: rpc.bootparamd prints an empty line when debug mode
To: None <gnats-bugs@gnats.netbsd.org>
From: None <enami@but-b.or.jp>
List: netbsd-bugs
Date: 09/02/1997 22:43:49
>Number: 4076
>Category: bin
>Synopsis: rpc.bootparamd prints an empty line when debug mode
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Sep 2 06:50:00 1997
>Last-Modified:
>Originator: enami tsugutomo
>Organization:
>Release: NetBSD-current as of 1997Aug31
>Environment:
System: NetBSD pavlov.enami.ba2.so-net.or.jp 1.2G NetBSD 1.2G (PAVLOV) #318: Sun Aug 24 10:28:41 JST 1997 enami@pavlov.enami.ba2.so-net.or.jp:/b/netbsd/kernel/compile/PAVLOV i386
>Description:
rpc.bootparamd prints an empty line when debug mode.
>How-To-Repeat:
Run rpc.bootparamd with debug option, and see how does it print.
It prints an extra empty line after every debug prints. Unless it
is intended, it's unnecessary.
>Fix:
Since warnx() prints \n by itself, noneed to pass explicitly.
Also, syslog() will add \n if there is no \n.
cvs diff: Diffing .
Index: bootparamd.c
===================================================================
RCS file: /a/cvsroot/NetBSD/src/usr.sbin/rpc.bootparamd/bootparamd.c,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 bootparamd.c
--- bootparamd.c 1997/07/28 13:17:51 1.1.1.5
+++ bootparamd.c 1997/08/10 01:43:16
@@ -85,7 +85,7 @@
}
he = gethostbyname(optarg);
if (he == 0) {
- warnx("no such host: %s\n", optarg);
+ warnx("no such host: %s", optarg);
usage();
}
bcopy(he->h_addr, &route_addr.s_addr, he->h_length);
@@ -144,13 +144,13 @@
long haddr;
if (debug)
- warnx("whoami got question for %d.%d.%d.%d\n",
+ warnx("whoami got question for %d.%d.%d.%d",
255 & whoami->client_address.bp_address_u.ip_addr.net,
255 & whoami->client_address.bp_address_u.ip_addr.host,
255 & whoami->client_address.bp_address_u.ip_addr.lh,
255 & whoami->client_address.bp_address_u.ip_addr.impno);
if (dolog)
- syslog(LOG_NOTICE, "whoami got question for %d.%d.%d.%d\n",
+ syslog(LOG_NOTICE, "whoami got question for %d.%d.%d.%d",
255 & whoami->client_address.bp_address_u.ip_addr.net,
255 & whoami->client_address.bp_address_u.ip_addr.host,
255 & whoami->client_address.bp_address_u.ip_addr.lh,
@@ -167,9 +167,9 @@
}
if (debug)
- warnx("This is host %s\n", askname);
+ warnx("This is host %s", askname);
if (dolog)
- syslog(LOG_NOTICE, "This is host %s\n", askname);
+ syslog(LOG_NOTICE, "This is host %s", askname);
if (!lookup_bootparam(askname, hostname, NULL, NULL, NULL)) {
res.client_name = hostname;
@@ -182,14 +182,14 @@
&res.router_address.bp_address_u.ip_addr, 4);
}
if (debug)
- warnx("Returning %s %s %d.%d.%d.%d\n",
+ warnx("Returning %s %s %d.%d.%d.%d",
res.client_name, res.domain_name,
255 & res.router_address.bp_address_u.ip_addr.net,
255 & res.router_address.bp_address_u.ip_addr.host,
255 & res.router_address.bp_address_u.ip_addr.lh,
255 & res.router_address.bp_address_u.ip_addr.impno);
if (dolog)
- syslog(LOG_NOTICE, "Returning %s %s %d.%d.%d.%d\n",
+ syslog(LOG_NOTICE, "Returning %s %s %d.%d.%d.%d",
res.client_name, res.domain_name,
255 & res.router_address.bp_address_u.ip_addr.net,
255 & res.router_address.bp_address_u.ip_addr.host,
@@ -199,9 +199,9 @@
return (&res);
}
if (debug)
- warnx("whoami failed\n");
+ warnx("whoami failed");
if (dolog)
- syslog(LOG_NOTICE, "whoami failed\n");
+ syslog(LOG_NOTICE, "whoami failed");
return (NULL);
}
@@ -216,11 +216,11 @@
int err;
if (debug)
- warnx("getfile got question for \"%s\" and file \"%s\"\n",
+ warnx("getfile got question for \"%s\" and file \"%s\"",
getfile->client_name, getfile->file_id);
if (dolog)
- syslog(LOG_NOTICE, "getfile got question for \"%s\" and file \"%s\"\n",
+ syslog(LOG_NOTICE, "getfile got question for \"%s\" and file \"%s\"",
getfile->client_name, getfile->file_id);
he = NULL;
@@ -245,17 +245,17 @@
} else {
failed:
if (debug)
- warnx("getfile failed for %s\n",
+ warnx("getfile failed for %s",
getfile->client_name);
if (dolog)
syslog(LOG_NOTICE,
- "getfile failed for %s\n", getfile->client_name);
+ "getfile failed for %s", getfile->client_name);
return (NULL);
}
if (debug)
warnx(
- "returning server:%s path:%s address: %d.%d.%d.%d\n",
+ "returning server:%s path:%s address: %d.%d.%d.%d",
res.server_name, res.server_path,
255 & res.server_address.bp_address_u.ip_addr.net,
255 & res.server_address.bp_address_u.ip_addr.host,
@@ -263,7 +263,7 @@
255 & res.server_address.bp_address_u.ip_addr.impno);
if (dolog)
syslog(LOG_NOTICE,
- "returning server:%s path:%s address: %d.%d.%d.%d\n",
+ "returning server:%s path:%s address: %d.%d.%d.%d",
res.server_name, res.server_path,
255 & res.server_address.bp_address_u.ip_addr.net,
255 & res.server_address.bp_address_u.ip_addr.host,
>Audit-Trail:
>Unformatted: