summaryrefslogtreecommitdiff
path: root/usr.bin/tail
diff options
context:
space:
mode:
authorkstailey <kstailey@cvs.openbsd.org>1997-05-29 14:57:32 +0000
committerkstailey <kstailey@cvs.openbsd.org>1997-05-29 14:57:32 +0000
commit61ada49d6f2dfbb7be5102d1b966347fa6ef5b7b (patch)
tree268befdda5b5f17368252af4176a831fd9c89b48 /usr.bin/tail
parent2919478c2fee7a61c1d1790ac42fbe9ef7728064 (diff)
why select(2) when you can sleep(3) cheap?
Diffstat (limited to 'usr.bin/tail')
-rw-r--r--usr.bin/tail/forward.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c
index ecaa977d93e..55089c43416 100644
--- a/usr.bin/tail/forward.c
+++ b/usr.bin/tail/forward.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: forward.c,v 1.4 1997/01/12 23:43:05 millert Exp $ */
+/* $OpenBSD: forward.c,v 1.5 1997/05/29 14:57:31 kstailey Exp $ */
/* $NetBSD: forward.c,v 1.7 1996/02/13 16:49:10 ghudson Exp $ */
/*-
@@ -41,12 +41,11 @@
#if 0
static char sccsid[] = "@(#)forward.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: forward.c,v 1.4 1997/01/12 23:43:05 millert Exp $";
+static char rcsid[] = "$OpenBSD: forward.c,v 1.5 1997/05/29 14:57:31 kstailey Exp $";
#endif /* not lint */
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/time.h>
#include <sys/mman.h>
#include <err.h>
@@ -92,7 +91,6 @@ forward(fp, style, off, sbp)
struct stat *sbp;
{
register int ch;
- struct timeval second;
switch(style) {
case FBYTES:
@@ -176,15 +174,7 @@ forward(fp, style, off, sbp)
(void)fflush(stdout);
if (!fflag)
break;
- /*
- * We pause for one second after displaying any data that has
- * accumulated since we read the file. Since sleep(3) takes
- * eight system calls, use select() instead.
- */
- second.tv_sec = 1;
- second.tv_usec = 0;
- if (select(0, NULL, NULL, NULL, &second) == -1)
- err(1, "select");
+ sleep(1);
clearerr(fp);
}
}