| Summary: | Extensions to biff(1) | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | howardjp <howardjp> | ||||
| Component: | bin | Assignee: | Johan Karlsson <johan> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 3.2-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
howardjp
1999-08-11 13:30:03 UTC
Responsible Changed From-To: freebsd-bugs->billf I'll look at this. Responsible Changed From-To: billf->johan Bill suggested I should have look at this. 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. 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
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. |