From 61ada49d6f2dfbb7be5102d1b966347fa6ef5b7b Mon Sep 17 00:00:00 2001 From: kstailey Date: Thu, 29 May 1997 14:57:32 +0000 Subject: why select(2) when you can sleep(3) cheap? --- usr.bin/tail/forward.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'usr.bin/tail') 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 #include -#include #include #include @@ -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); } } -- cgit v1.2.3