Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/usr.bin/tail pull up rev 1.7 from trunk. (cgd)



details:   https://anonhg.NetBSD.org/src/rev/3e581063781d
branches:  netbsd-1-4
changeset: 469242:3e581063781d
user:      cgd <cgd%NetBSD.org@localhost>
date:      Fri Aug 20 05:36:25 1999 +0000

description:
pull up rev 1.7 from trunk. (cgd)

diffstat:

 usr.bin/tail/read.c |  18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diffs (74 lines):

diff -r bb40f903ef7d -r 3e581063781d usr.bin/tail/read.c
--- a/usr.bin/tail/read.c       Fri Aug 20 05:36:20 1999 +0000
+++ b/usr.bin/tail/read.c       Fri Aug 20 05:36:25 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: read.c,v 1.6 1998/11/03 14:27:09 christos Exp $        */
+/*     $NetBSD: read.c,v 1.6.2.1 1999/08/20 05:36:25 cgd Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)read.c     8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: read.c,v 1.6 1998/11/03 14:27:09 christos Exp $");
+__RCSID("$NetBSD: read.c,v 1.6.2.1 1999/08/20 05:36:25 cgd Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -63,8 +63,10 @@
  * routine has the usual nastiness of trying to find the newlines.  Otherwise,
  * it is displayed from the character closest to the beginning of the input to
  * the end.
+ *
+ * Non-zero return means than a (non-fatal) error occurred.
  */
-void
+int
 bytes(fp, off)
        FILE *fp;
        off_t off;
@@ -86,7 +88,7 @@
        }
        if (ferror(fp)) {
                ierr();
-               return;
+               return (1);
        }
 
        if (rflag) {
@@ -119,6 +121,7 @@
                if ((len = p - sp) == 0)
                        WR(sp, len);
        }
+       return (0);
 }
 
 /*
@@ -130,8 +133,10 @@
  * routine has the usual nastiness of trying to find the newlines.  Otherwise,
  * it is displayed from the line closest to the beginning of the input to
  * the end.
+ *
+ * Non-zero return means than a (non-fatal) error occurred.
  */
-void
+int
 lines(fp, off)
        FILE *fp;
        off_t off;
@@ -180,7 +185,7 @@
        }
        if (ferror(fp)) {
                ierr();
-               return;
+               return (1);
        }
        if (cnt) {
                lines[recno].l = sp;
@@ -204,4 +209,5 @@
                for (cnt = 0; cnt < recno; ++cnt)
                        WR(lines[cnt].l, lines[cnt].len);
        }
+       return (0);
 }



Home | Main Index | Thread Index | Old Index