diff options
author | sheldonh <sheldonh@FreeBSD.org> | 1999-07-02 12:31:31 +0000 |
---|---|---|
committer | sheldonh <sheldonh@FreeBSD.org> | 1999-07-02 12:31:31 +0000 |
commit | 9b08a567c1d6bdc82429bde3fafebf9effe09bba (patch) | |
tree | d7e6e7cdf5398b5582b0ab3330e709235cd42ff4 /usr.sbin/ac | |
parent | ae73a7933284521689089923d4b4aa853b4e0fa7 (diff) | |
download | FreeBSD-src-9b08a567c1d6bdc82429bde3fafebf9effe09bba.zip FreeBSD-src-9b08a567c1d6bdc82429bde3fafebf9effe09bba.tar.gz |
Back out previous commit. Allowing `-' as a pseudonym for /dev/stdin is
legacy behaviour inherited from systems that don't have /dev/stdin.
Requested by: bde
Diffstat (limited to 'usr.sbin/ac')
-rw-r--r-- | usr.sbin/ac/ac.8 | 5 | ||||
-rw-r--r-- | usr.sbin/ac/ac.c | 20 |
2 files changed, 7 insertions, 18 deletions
diff --git a/usr.sbin/ac/ac.8 b/usr.sbin/ac/ac.8 index b19e200..aa062e2 100644 --- a/usr.sbin/ac/ac.8 +++ b/usr.sbin/ac/ac.8 @@ -28,7 +28,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: ac.8,v 1.10 1997/09/01 06:11:40 charnier Exp $ +.\" $Id: ac.8,v 1.11 1999/06/30 21:46:02 sheldonh Exp $ .\" .Dd March 15, 1994 .Dt AC 8 @@ -84,9 +84,6 @@ Read connect time data from .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 diff --git a/usr.sbin/ac/ac.c b/usr.sbin/ac/ac.c index 1d73bd0..f9f90eb 100644 --- a/usr.sbin/ac/ac.c +++ b/usr.sbin/ac/ac.c @@ -15,7 +15,7 @@ #ifndef lint static const char rcsid[] = - "$Id: ac.c,v 1.10 1998/07/02 05:34:08 phk Exp $"; + "$Id: ac.c,v 1.11 1999/06/30 21:46:03 sheldonh Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -106,20 +106,12 @@ file(name) { FILE *fp; - /* - * Added by GAW... - */ - if (strcmp("-", name) == 0) { + 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 (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; - } + return fp; } struct tty_list * |