[BACK]Return to forward.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tail

Diff for /src/usr.bin/tail/forward.c between version 1.1 and 1.2

version 1.1, 1995/10/18 08:46:11 version 1.2, 1996/02/23 15:10:30
Line 1 
Line 1 
 /*      $NetBSD: forward.c,v 1.6 1994/11/23 07:42:02 jtc Exp $  */  /*      $NetBSD: forward.c,v 1.7 1996/02/13 16:49:10 ghudson Exp $      */
   
 /*-  /*-
  * Copyright (c) 1991, 1993   * Copyright (c) 1991, 1993
Line 40 
Line 40 
 #if 0  #if 0
 static char sccsid[] = "@(#)forward.c   8.1 (Berkeley) 6/6/93";  static char sccsid[] = "@(#)forward.c   8.1 (Berkeley) 6/6/93";
 #endif  #endif
 static char rcsid[] = "$NetBSD: forward.c,v 1.6 1994/11/23 07:42:02 jtc Exp $";  static char rcsid[] = "$NetBSD: forward.c,v 1.7 1996/02/13 16:49:10 ghudson Exp $";
 #endif /* not lint */  #endif /* not lint */
   
 #include <sys/types.h>  #include <sys/types.h>
Line 90 
Line 90 
 {  {
         register int ch;          register int ch;
         struct timeval second;          struct timeval second;
         fd_set zero;  
   
         switch(style) {          switch(style) {
         case FBYTES:          case FBYTES:
Line 163 
Line 162 
                 break;                  break;
         }          }
   
         /*  
          * We pause for one second after displaying any data that has  
          * accumulated since we read the file.  
          */  
         if (fflag) {  
                 FD_ZERO(&zero);  
                 second.tv_sec = 1;  
                 second.tv_usec = 0;  
         }  
   
         for (;;) {          for (;;) {
                 while ((ch = getc(fp)) != EOF)                  while ((ch = getc(fp)) != EOF)
                         if (putchar(ch) == EOF)                          if (putchar(ch) == EOF)
Line 184 
Line 173 
                 (void)fflush(stdout);                  (void)fflush(stdout);
                 if (!fflag)                  if (!fflag)
                         break;                          break;
                 /* Sleep(3) is eight system calls.  Do it fast. */                  /*
                 if (select(0, &zero, &zero, &zero, &second) == -1)                   * 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: %s", strerror(errno));                          err(1, "select: %s", strerror(errno));
                 clearerr(fp);                  clearerr(fp);
         }          }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2