[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.17 and 1.18

version 1.17, 2003/07/14 08:06:06 version 1.18, 2004/02/16 19:48:21
Line 56 
Line 56 
   
 #include "extern.h"  #include "extern.h"
   
 static int rlines(FILE *, long, struct stat *);  static int rlines(FILE *, off_t, struct stat *);
   
 /*  /*
  * forward -- display the file, from an offset, forward.   * forward -- display the file, from an offset, forward.
Line 84 
Line 84 
 forward(fp, style, off, sbp)  forward(fp, style, off, sbp)
         FILE *fp;          FILE *fp;
         enum STYLE style;          enum STYLE style;
         long off;          off_t off;
         struct stat *sbp;          struct stat *sbp;
 {  {
         int ch;          int ch;
Line 99 
Line 99 
                 if (S_ISREG(sbp->st_mode)) {                  if (S_ISREG(sbp->st_mode)) {
                         if (sbp->st_size < off)                          if (sbp->st_size < off)
                                 off = sbp->st_size;                                  off = sbp->st_size;
                         if (fseek(fp, off, SEEK_SET) == -1) {                          if (fseeko(fp, off, SEEK_SET) == -1) {
                                 ierr();                                  ierr();
                                 return;                                  return;
                         }                          }
Line 130 
Line 130 
         case RBYTES:          case RBYTES:
                 if (S_ISREG(sbp->st_mode)) {                  if (S_ISREG(sbp->st_mode)) {
                         if (sbp->st_size >= off &&                          if (sbp->st_size >= off &&
                             fseek(fp, -off, SEEK_END) == -1) {                              fseeko(fp, -off, SEEK_END) == -1) {
                                 ierr();                                  ierr();
                                 return;                                  return;
                         }                          }
Line 149 
Line 149 
         case RLINES:          case RLINES:
                 if (S_ISREG(sbp->st_mode)) {                  if (S_ISREG(sbp->st_mode)) {
                         if (!off) {                          if (!off) {
                                 if (fseek(fp, 0L, SEEK_END) == -1) {                                  if (fseeko(fp, (off_t)0, SEEK_END) == -1) {
                                         ierr();                                          ierr();
                                         return;                                          return;
                                 }                                  }
Line 249 
Line 249 
  * rlines -- display the last offset lines of the file.   * rlines -- display the last offset lines of the file.
  */   */
 static int  static int
 rlines(FILE *fp, long off, struct stat *sbp)  rlines(FILE *fp, off_t off, struct stat *sbp)
 {  {
         off_t pos;          off_t pos;
         int ch;          int ch;

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18