From nobody@FreeBSD.org  Mon Dec  3 04:21:09 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id F1AA2747
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  3 Dec 2012 04:21:09 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id BFF4D8FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  3 Dec 2012 04:21:09 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qB34L9gx043942
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 3 Dec 2012 04:21:09 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id qB34L95Z043932;
	Mon, 3 Dec 2012 04:21:09 GMT
	(envelope-from nobody)
Message-Id: <201212030421.qB34L95Z043932@red.freebsd.org>
Date: Mon, 3 Dec 2012 04:21:09 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] style(9) fixes for xargs(1)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         174073
>Category:       bin
>Synopsis:       [patch] style(9) fixes for xargs(1)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 03 04:30:00 UTC 2012
>Closed-Date:    Thu May 16 12:21:13 UTC 2013
>Last-Modified:  Thu May 16 12:21:13 UTC 2013
>Originator:     Garrett Cooper
>Release:        n/a
>Organization:
EMC Isilon
>Environment:
n/a
>Description:
The attached patch consists of style(9) fixes for xargs(1) that I submitted to mckay@ and he acked, but weren't committed.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: usr.bin/xargs/xargs.c
===================================================================
--- usr.bin/xargs/xargs.c	(revision 243802)
+++ usr.bin/xargs/xargs.c	(working copy)
@@ -98,8 +98,8 @@
 main(int argc, char *argv[])
 {
 	long arg_max;
+	size_t linelen;
 	int ch, Jflag, nargs, nflag, nline;
-	size_t linelen;
 	char *endptr;
 
 	inpline = replstr = NULL;
@@ -126,10 +126,9 @@
 	if ((arg_max = sysconf(_SC_ARG_MAX)) == -1)
 		errx(1, "sysconf(_SC_ARG_MAX) failed");
 	nline = arg_max - 4 * 1024;
-	while (*ep != NULL) {
+	while (*ep != NULL)
 		/* 1 byte for each '\0' */
-		nline -= strlen(*ep++) + 1 + sizeof(*ep);
-	}
+		nline -= strlen(*ep++) + 1 + sizeof(*ep);	
 	maxprocs = 1;
 	while ((ch = getopt(argc, argv, "0E:I:J:L:n:oP:pR:S:s:rtx")) != -1)
 		switch (ch) {
@@ -524,9 +523,9 @@
 static void
 run(char **argv)
 {
+	char **avec;
 	pid_t pid;
 	int fd;
-	char **avec;
 
 	/*
 	 * If the user wants to be notified of each command before it is
@@ -568,9 +567,8 @@
 		if (oflag) {
 			if ((fd = open(_PATH_TTY, O_RDONLY)) == -1)
 				err(1, "can't open /dev/tty");
-		} else {
+		} else
 			fd = open(_PATH_DEVNULL, O_RDONLY);
-		}
 		if (fd > STDIN_FILENO) {
 			if (dup2(fd, STDIN_FILENO) != 0)
 				err(1, "can't dup2 to stdin");
@@ -593,7 +591,8 @@
  * If block is not set and no children have exited, returns 0 immediately.
  */
 static pid_t
-xwait(int block, int *status) {
+xwait(int block, int *status)
+{
 	pid_t pid;
 
 	if (pids_empty()) {
@@ -670,12 +669,14 @@
 static int
 pids_empty(void)
 {
+
 	return (curprocs == 0);
 }
 
 static int
 pids_full(void)
 {
+
 	return (curprocs >= maxprocs);
 }
 
@@ -709,7 +710,6 @@
 
 	if ((slot = findslot(NOPID)) < 0)
 		errx(1, "internal error: no free pid slot");
-
 	return (slot);
 }
 
@@ -721,13 +721,13 @@
 	for (slot = 0; slot < maxprocs; slot++)
 		if (childpids[slot] == pid)
 			return (slot);
-
 	return (-1);
 }
 
 static void
 clearslot(int slot)
 {
+
 	childpids[slot] = NOPID;
 }
 


>Release-Note:
>Audit-Trail:

From: Jaakko Heinonen <jh@FreeBSD.org>
To: Garrett Cooper <yanegomi@gmail.com>, eadler@FreeBSD.org
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/174073: [patch] style(9) fixes for xargs(1)
Date: Thu, 16 May 2013 14:43:37 +0300

 On 2012-12-03, Garrett Cooper wrote:
 > The attached patch consists of style(9) fixes for xargs(1) that I
 > submitted to mckay@ and he acked, but weren't committed.
 
 Partially(?) committed in r250431.
 
 -- 
 Jaakko
State-Changed-From-To: open->closed 
State-Changed-By: eadler 
State-Changed-When: Thu May 16 12:21:12 UTC 2013 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174073 
>Unformatted:
