From owner-freebsd-ports Wed Jun 30 10:40: 4 1999 Delivered-To: freebsd-ports@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id C6C2615583 for ; Wed, 30 Jun 1999 10:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id KAA42748; Wed, 30 Jun 1999 10:40:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 4FA8A154BC for ; Wed, 30 Jun 1999 10:36:34 -0700 (PDT) (envelope-from root@ca.lcs.mit.edu) Received: from ca.lcs.mit.edu (ca.lcs.mit.edu [18.24.10.177]) by khavrinen.lcs.mit.edu (8.9.1/8.9.1) with ESMTP id NAA25275 for ; Wed, 30 Jun 1999 13:36:33 -0400 (EDT) (envelope-from root@ca.lcs.mit.edu) Received: (from root@localhost) by ca.lcs.mit.edu (8.9.3/8.9.3) id NAA19774; Wed, 30 Jun 1999 13:32:34 -0400 (EDT) (envelope-from root@ca.lcs.mit.edu) Message-Id: <199906301732.NAA19774@ca.lcs.mit.edu> Date: Wed, 30 Jun 1999 13:32:34 -0400 (EDT) From: Charlie Root Reply-To: root@ca.lcs.mit.edu To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: ports/12467: ac(8) does not accept input from stdin Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 12467 >Category: ports >Synopsis: ac(8) does not accept input from stdin >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Jun 30 10:40:00 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Garrett A. Wollman >Release: FreeBSD 4.0-CURRENT i386 >Organization: MIT Laboratory for Computer Science >Environment: Irrelevant. >Description: If wtmp files are gzipped, you'd like to be able to use ac in a pipeline with gunzip. >How-To-Repeat: $ gzip -dc /var/log/wtmp*gz | ac -d -w - ac: -: No such file or directory >Fix: Index: ac.8 =================================================================== RCS file: /home/ncvs/src/usr.sbin/ac/ac.8,v retrieving revision 1.10 diff -u -r1.10 ac.8 --- ac.8 1997/09/01 06:11:40 1.10 +++ ac.8 1999/06/30 17:26:41 @@ -84,6 +84,9 @@ .Ar wtmp instead of the default file, .Pa /var/log/wtmp . +If +.Ql \&- +is specified, read records from the standard input. .It Ar users ... Display totals for the given individuals only. .El Index: ac.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/ac/ac.c,v retrieving revision 1.10 diff -u -r1.10 ac.c --- ac.c 1998/07/02 05:34:08 1.10 +++ ac.c 1999/06/30 17:25:34 @@ -106,12 +106,20 @@ { FILE *fp; - if ((fp = fopen(name, "r")) == NULL) - err(1, "%s", name); - /* in case we want to discriminate */ - if (strcmp(_PATH_WTMP, name)) + /* + * Added by GAW... + */ + if (strcmp("-", name) == 0) { Flags |= AC_W; - return fp; + return (stdin); + } else { + if ((fp = fopen(name, "r")) == NULL) + err(1, "%s", name); + /* in case we want to discriminate */ + if (strcmp(_PATH_WTMP, name)) + Flags |= AC_W; + return fp; + } } struct tty_list * >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message