Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jul 2002 16:47:06 +0200
From:      Cyrille Lefevre <cyrille.lefevre@laposte.net>
To:        freebsd-gnats-submit@FreeBSD.org, howardjp@wam.umd.edu
Cc:        freebsd arch <freebsd-arch@FreeBSD.org>
Subject:   Re: bin/13072: Extensions to biff(1)
Message-ID:  <20020724144705.GA13971@gits.dyndns.org>

next in thread | raw e-mail | index | archive | help
see PR #13073 for comments.

* errno.h and string.h not needed.
* other headers sorted (see style(9)).

Index: /usr/src/usr.bin/biff/biff.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/biff/biff.c,v
retrieving revision 1.6.2.3
diff -u -r1.6.2.3 biff.c
--- /usr/src/usr.bin/biff/biff.c	2 Aug 2001 01:06:37 -0000	1.6.2.3
+++ /usr/src/usr.bin/biff/biff.c	24 Jul 2002 14:36:05 -0000
@@ -45,12 +45,11 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <errno.h>
-#include <unistd.h>
+
+#include <err.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
-#include <err.h>
+#include <unistd.h>
 
 int main __P((int, char *[]));
 static void usage __P((void));
@@ -66,7 +65,7 @@
 
 
 	while ((ch = getopt(argc, argv, "")) != -1)
-		switch(ch) {
+		switch (ch) {
 		case '?':
 		default:
 			usage();
@@ -74,7 +73,9 @@
 	argc -= optind;
 	argv += optind;
 
-	if ((name = ttyname(STDERR_FILENO)) == NULL)
+	if ((name = ttyname(STDIN_FILENO)) == NULL &&
+	    (name = ttyname(STDOUT_FILENO)) == NULL &&
+	    (name = ttyname(STDERR_FILENO)) == NULL)
 		err(2, "unknown tty");
 
 	if (stat(name, &sb))

Cyrille.
-- 
Cyrille Lefevre                 mailto:cyrille.lefevre@laposte.net

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020724144705.GA13971>