misc/146088: [patch] netrate/tcpconnect incorrectly uses err()

pluknet pluknet at gmail.com
Tue Apr 27 13:40:02 UTC 2010


>Number:         146088
>Category:       misc
>Synopsis:       [patch] netrate/tcpconnect incorrectly uses err()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 27 13:40:01 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     pluknet
>Release:        HEAD r207204
>Organization:
>Environment:
FreeBSD 9.0-CURRENT #10: Mon Apr 26 22:06:30 UTC 2010
>Description:
In netrate/tcpconnect usage() calls err() if no arguments given (with always errno=0).
That produces dirty error message:
tcpconnect: usage: tcpconnect [ip]: Unknown error: 0
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: tools/tools/netrate/tcpconnect/tcpconnect.c
===================================================================
--- tools/tools/netrate/tcpconnect/tcpconnect.c	(revision 207204)
+++ tools/tools/netrate/tcpconnect/tcpconnect.c	(working copy)
@@ -110,7 +110,7 @@
 	u_int64_t counter;
 
 	if (argc != 2)
-		err(-1, "usage: tcpconnect [ip]");
+		errx(-1, "usage: tcpconnect [ip]");
 
 	bzero(&sin, sizeof(sin));
 	sin.sin_family = AF_INET;


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list