mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
There is no reason for logname to call getopt(3), it doesn't take
any options. PR: 26689 Submitted by: Félix-Antoine Paradis <reel@sympatico.ca>
This commit is contained in:
parent
7998b1245d
commit
c689eed5f3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=77789
|
@ -29,6 +29,8 @@
|
|||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
|
@ -55,18 +57,10 @@ main(argc, argv)
|
|||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
int ch;
|
||||
char *p;
|
||||
|
||||
while ((ch = getopt(argc, argv, "")) != -1)
|
||||
switch (ch) {
|
||||
case '?':
|
||||
default:
|
||||
if (argc != 1)
|
||||
usage();
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if ((p = getlogin()) == NULL)
|
||||
err(1, NULL);
|
||||
(void)printf("%s\n", p);
|
||||
|
|
Loading…
Reference in a new issue