Bug 13072

Summary: Extensions to biff(1)
Product: Base System Reporter: howardjp <howardjp>
Component: binAssignee: Johan Karlsson <johan>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.2-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description howardjp 1999-08-11 13:30:03 UTC
Often when I am logged in via telnet to a FreeBSD host, I use Lynx to
download files.  If it is a large download, the arrival of mail
notifications can mess up the display of Lynx's status.  This patch
to biff(1) will allow you to use "biff -t tty" report or change the
status of tty instead of the current.  I do this often from a second
telnet session.

How-To-Repeat: 
Irrelevant.
Comment 1 bill fumerola freebsd_committer freebsd_triage 1999-08-11 15:16:39 UTC
Responsible Changed
From-To: freebsd-bugs->billf

I'll look at this. 
Comment 2 Johan Karlsson freebsd_committer freebsd_triage 2002-07-09 18:34:39 UTC
Responsible Changed
From-To: billf->johan

Bill suggested I should have look at this.
Comment 3 Johan Karlsson freebsd_committer freebsd_triage 2002-07-11 19:13:08 UTC
State Changed
From-To: open->analyzed

This seems to be a good change. 
Pending no objection from -standards and -arch 
I will commit this soon.
Comment 4 Cyrille Lefevre 2002-07-24 15:47:06 UTC
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
Comment 5 Johan Karlsson freebsd_committer freebsd_triage 2002-07-24 16:56:20 UTC
State Changed
From-To: analyzed->closed

One can now use redirection of stdin to select 
another tty. 

# biff n < /dev/ttyp1 

I think this is good enough. If you don't, please 
argu your case on freebsd-arch@freebsd.org.