summaryrefslogtreecommitdiff
path: root/usr.bin/tail
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2001-09-01 22:22:45 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2001-09-01 22:22:45 +0000
commitbd9dc97512fff91e14353a573b5ffbb200bf16bf (patch)
tree76b6a36fea6e5f73587204b78bcc976c69d43fc9 /usr.bin/tail
parentfd818070c81764d5c07cce44de7bf701a93fe9c5 (diff)
downloadsrc-test2-bd9dc97512fff91e14353a573b5ffbb200bf16bf.tar.gz
src-test2-bd9dc97512fff91e14353a573b5ffbb200bf16bf.zip
Notes
Diffstat (limited to 'usr.bin/tail')
-rw-r--r--usr.bin/tail/extern.h4
-rw-r--r--usr.bin/tail/forward.c14
-rw-r--r--usr.bin/tail/reverse.c6
-rw-r--r--usr.bin/tail/tail.c4
4 files changed, 14 insertions, 14 deletions
diff --git a/usr.bin/tail/extern.h b/usr.bin/tail/extern.h
index cdf6929d10bb..8c549a9f0bdc 100644
--- a/usr.bin/tail/extern.h
+++ b/usr.bin/tail/extern.h
@@ -52,8 +52,8 @@ struct mapinfo {
enum STYLE { NOTSET = 0, FBYTES, FLINES, RBYTES, RLINES, REVERSE };
-void forward __P((FILE *, enum STYLE, long, struct stat *));
-void reverse __P((FILE *, enum STYLE, long, struct stat *));
+void forward __P((FILE *, enum STYLE, off_t, struct stat *));
+void reverse __P((FILE *, enum STYLE, off_t, struct stat *));
int bytes __P((FILE *, off_t));
int lines __P((FILE *, off_t));
diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c
index cd1980f1e656..ceacc04213fd 100644
--- a/usr.bin/tail/forward.c
+++ b/usr.bin/tail/forward.c
@@ -58,7 +58,7 @@ static const char rcsid[] =
#include <err.h>
#include "extern.h"
-static void rlines __P((FILE *, long, struct stat *));
+static void rlines __P((FILE *, off_t, struct stat *));
/* defines for inner loop actions */
#define USE_SLEEP 0
@@ -91,7 +91,7 @@ void
forward(fp, style, off, sbp)
FILE *fp;
enum STYLE style;
- long off;
+ off_t off;
struct stat *sbp;
{
int ch, kq = -1;
@@ -106,7 +106,7 @@ forward(fp, style, off, sbp)
if (S_ISREG(sbp->st_mode)) {
if (sbp->st_size < off)
off = sbp->st_size;
- if (fseek(fp, off, SEEK_SET) == -1) {
+ if (fseeko(fp, off, SEEK_SET) == -1) {
ierr();
return;
}
@@ -137,7 +137,7 @@ forward(fp, style, off, sbp)
case RBYTES:
if (S_ISREG(sbp->st_mode)) {
if (sbp->st_size >= off &&
- fseek(fp, -off, SEEK_END) == -1) {
+ fseeko(fp, -off, SEEK_END) == -1) {
ierr();
return;
}
@@ -154,7 +154,7 @@ forward(fp, style, off, sbp)
case RLINES:
if (S_ISREG(sbp->st_mode))
if (!off) {
- if (fseek(fp, 0L, SEEK_END) == -1) {
+ if (fseeko(fp, (off_t)0, SEEK_END) == -1) {
ierr();
return;
}
@@ -226,7 +226,7 @@ forward(fp, style, off, sbp)
action = USE_SLEEP;
} else if (ev->data < 0) {
/* file shrank, reposition to end */
- if (fseek(fp, 0L, SEEK_END) == -1) {
+ if (fseeko(fp, (off_t)0, SEEK_END) == -1) {
ierr();
return;
}
@@ -266,7 +266,7 @@ forward(fp, style, off, sbp)
static void
rlines(fp, off, sbp)
FILE *fp;
- long off;
+ off_t off;
struct stat *sbp;
{
struct mapinfo map;
diff --git a/usr.bin/tail/reverse.c b/usr.bin/tail/reverse.c
index 24468dd1a23a..83d21d9b00dd 100644
--- a/usr.bin/tail/reverse.c
+++ b/usr.bin/tail/reverse.c
@@ -56,7 +56,7 @@ static const char rcsid[] =
#include "extern.h"
static void r_buf __P((FILE *));
-static void r_reg __P((FILE *, enum STYLE, long, struct stat *));
+static void r_reg __P((FILE *, enum STYLE, off_t, struct stat *));
/*
* reverse -- display input in reverse order by line.
@@ -80,7 +80,7 @@ void
reverse(fp, style, off, sbp)
FILE *fp;
enum STYLE style;
- long off;
+ off_t off;
struct stat *sbp;
{
if (style != REVERSE && off == 0)
@@ -111,7 +111,7 @@ static void
r_reg(fp, style, off, sbp)
FILE *fp;
enum STYLE style;
- long off;
+ off_t off;
struct stat *sbp;
{
struct mapinfo map;
diff --git a/usr.bin/tail/tail.c b/usr.bin/tail/tail.c
index 911dcda00bf5..9b7d9a293ad7 100644
--- a/usr.bin/tail/tail.c
+++ b/usr.bin/tail/tail.c
@@ -71,7 +71,7 @@ main(argc, argv)
{
struct stat sb;
FILE *fp;
- long off;
+ off_t off;
enum STYLE style;
int ch, first;
char *p;
@@ -91,7 +91,7 @@ main(argc, argv)
#define ARG(units, forward, backward) { \
if (style) \
usage(); \
- off = strtol(optarg, &p, 10) * (units); \
+ off = strtoll(optarg, &p, 10) * (units); \
if (*p) \
errx(1, "illegal offset -- %s", optarg); \
switch(optarg[0]) { \