Bug 195330 - Reduce gpioctl output
Summary: Reduce gpioctl output
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: Normal Affects Some People
Assignee: Rui Paulo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-24 09:10 UTC by Scott Ellis
Modified: 2014-12-05 07:53 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Ellis 2014-11-24 09:10:21 UTC
gpioctl enumerates non-switch cmdline args to stdout when
doing simple reads or writes.

root@duovero:~ # gpioctl 110
0/110
0
root@duovero:~ # gpioctl 110 1
0/110
1/1
root@duovero:~ # gpioctl 110
0/110
1

It's confusing and not documented.

I'm suggesting removing those lines so the output looks like

root@duovero:~ # gpioctl 110
1
root@duovero:~ # gpioctl 110 0
root@duovero:~ # gpioctl 110
0


scott@fbsd:/usr/src/usr.sbin % svn diff
Index: gpioctl/gpioctl.c
===================================================================
--- gpioctl/gpioctl.c   (revision 274926)
+++ gpioctl/gpioctl.c   (working copy)
@@ -224,8 +224,6 @@
        }
        argv += optind;
        argc -= optind;
-       for (i = 0; i < argc; i++)
-               printf("%d/%s\n", i, argv[i]);

        if (ctlfile == NULL)
                ctlfile = defctlfile;
Comment 1 commit-hook freebsd_committer freebsd_triage 2014-12-02 19:41:40 UTC
A commit references this bug:

Author: rpaulo
Date: Tue Dec  2 19:41:25 UTC 2014
New revision: 275420
URL: https://svnweb.freebsd.org/changeset/base/275420

Log:
  gpioctl: don't print the command line arguments.

  PR:		195330
  Submitted by:	Scott Ellis jumpnowtek at gmail.com
  MFC after:	3 days

Changes:
  head/usr.sbin/gpioctl/gpioctl.c
Comment 2 Rui Paulo freebsd_committer freebsd_triage 2014-12-02 19:42:09 UTC
Patch committed.  Will MFC in 3 days. Thanks.
Comment 3 commit-hook freebsd_committer freebsd_triage 2014-12-05 07:52:28 UTC
A commit references this bug:

Author: rpaulo
Date: Fri Dec  5 07:51:51 UTC 2014
New revision: 275500
URL: https://svnweb.freebsd.org/changeset/base/275500

Log:
  MFC r275420:

   gpioctl: don't print the command line arguments.

  PR:	  	195330
  Submitted by:	Scott Ellis jumpnowtek at gmail.com

Changes:
_U  stable/10/
  stable/10/usr.sbin/gpioctl/gpioctl.c