diff options
| -rw-r--r-- | usr.bin/less/ch.c | 6 | ||||
| -rw-r--r-- | usr.bin/less/decode.c | 2 | ||||
| -rw-r--r-- | usr.bin/less/edit.c | 2 | ||||
| -rw-r--r-- | usr.bin/less/filename.c | 4 | ||||
| -rw-r--r-- | usr.bin/less/less.h | 2 |
5 files changed, 7 insertions, 9 deletions
diff --git a/usr.bin/less/ch.c b/usr.bin/less/ch.c index 547345896d8..a4df21ab217 100644 --- a/usr.bin/less/ch.c +++ b/usr.bin/less/ch.c @@ -226,7 +226,7 @@ read_more: */ if (!(ch_flags & CH_CANSEEK)) return ('?'); - if (lseek(ch_file, (off_t)pos, SEEK_SET) == BAD_LSEEK) { + if (lseek(ch_file, (off_t)pos, SEEK_SET) == (off_t)-1) { error("seek error", NULL); clear_eol(); return (EOI); @@ -655,7 +655,7 @@ ch_flush(void) } #endif - if (lseek(ch_file, (off_t)0, SEEK_SET) == BAD_LSEEK) { + if (lseek(ch_file, (off_t)0, SEEK_SET) == (off_t)-1) { /* * Warning only; even if the seek fails for some reason, * there's a good chance we're at the beginning anyway. @@ -728,7 +728,7 @@ ch_delbufs(void) int seekable(int f) { - return (lseek(f, (off_t)1, SEEK_SET) != BAD_LSEEK); + return (lseek(f, (off_t)1, SEEK_SET) != (off_t)-1); } /* diff --git a/usr.bin/less/decode.c b/usr.bin/less/decode.c index a03c65606e6..0a9025bc2a8 100644 --- a/usr.bin/less/decode.c +++ b/usr.bin/less/decode.c @@ -647,7 +647,7 @@ lesskey(char *filename, int sysvar) (void) close(f); return (-1); } - if (lseek(f, (off_t)0, SEEK_SET) == BAD_LSEEK) { + if (lseek(f, (off_t)0, SEEK_SET) == (off_t)-1) { free(buf); (void) close(f); return (-1); diff --git a/usr.bin/less/edit.c b/usr.bin/less/edit.c index 9cdbcd6e4f0..fc01ec9c3d5 100644 --- a/usr.bin/less/edit.c +++ b/usr.bin/less/edit.c @@ -686,7 +686,7 @@ loop: * Append: open the file and seek to the end. */ logfile = open(filename, O_WRONLY | O_APPEND); - if (lseek(logfile, (off_t)0, SEEK_END) == BAD_LSEEK) { + if (lseek(logfile, (off_t)0, SEEK_END) == (off_t)-1) { close(logfile); logfile = -1; } diff --git a/usr.bin/less/filename.c b/usr.bin/less/filename.c index 43548aed45e..3ed929bd195 100644 --- a/usr.bin/less/filename.c +++ b/usr.bin/less/filename.c @@ -341,7 +341,7 @@ bin_file(int f) if (!seekable(f)) return (0); - if (lseek(f, (off_t)0, SEEK_SET) == BAD_LSEEK) + if (lseek(f, (off_t)0, SEEK_SET) == (off_t)-1) return (0); n = read(f, data, sizeof (data)); pend = &data[n]; @@ -370,7 +370,7 @@ seek_filesize(int f) off_t spos; spos = lseek(f, (off_t)0, SEEK_END); - if (spos == BAD_LSEEK) + if (spos == (off_t)-1) return (-1); return (spos); } diff --git a/usr.bin/less/less.h b/usr.bin/less/less.h index d76542b2ac6..a12291ae963 100644 --- a/usr.bin/less/less.h +++ b/usr.bin/less/less.h @@ -66,8 +66,6 @@ #define OPT_ON 1 #define OPT_ONPLUS 2 -#define BAD_LSEEK ((off_t)-1) - #ifndef CHAR_BIT #define CHAR_BIT 8 #endif |
