summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2015-11-06 15:09:07 +0000
committertedu <tedu@openbsd.org>2015-11-06 15:09:07 +0000
commit8c7533df77ec3ed6b0e36b65e05320a4f9673156 (patch)
tree6f2d4cdbc8106c14e536616f1305351770dabdbc
parentmake hfsc work on ie(4/sparc) by using IFQ_DEQUEUE instead of IF_DEQUEUE. (diff)
downloadwireguard-openbsd-8c7533df77ec3ed6b0e36b65e05320a4f9673156.tar.xz
wireguard-openbsd-8c7533df77ec3ed6b0e36b65e05320a4f9673156.zip
time_t is not a long. remove incorrect abstraction around time().
ok nicm
-rw-r--r--usr.bin/less/funcs.h1
-rw-r--r--usr.bin/less/linenum.c6
-rw-r--r--usr.bin/less/os.c12
3 files changed, 3 insertions, 16 deletions
diff --git a/usr.bin/less/funcs.h b/usr.bin/less/funcs.h
index 701eefd0780..6a2c69f81fb 100644
--- a/usr.bin/less/funcs.h
+++ b/usr.bin/less/funcs.h
@@ -227,7 +227,6 @@ extern void init_option(void);
extern struct loption *findopt(int);
extern struct loption *findopt_name(char **, char **, int *);
extern int iread(int, unsigned char *, unsigned int);
-extern long get_time(void);
extern char *errno_message(char *);
extern int percentage(off_t, off_t);
extern off_t percent_pos(off_t, int, long);
diff --git a/usr.bin/less/linenum.c b/usr.bin/less/linenum.c
index 8be49ed6f33..7218b325b9f 100644
--- a/usr.bin/less/linenum.c
+++ b/usr.bin/less/linenum.c
@@ -210,14 +210,14 @@ longloopmessage(void)
}
static int loopcount;
-static long startime;
+static time_t startime;
static void
longish(void)
{
if (loopcount >= 0 && ++loopcount > 100) {
loopcount = 0;
- if (get_time() >= startime + LONGTIME) {
+ if (time(NULL) >= startime + LONGTIME) {
longloopmessage();
loopcount = -1;
}
@@ -287,7 +287,7 @@ find_linenum(off_t pos)
* The decision is based on which way involves
* traversing fewer bytes in the file.
*/
- startime = get_time();
+ startime = time(NULL);
if (p == &anchor || pos - p->prev->pos < p->pos - pos) {
/*
* Go forward.
diff --git a/usr.bin/less/os.c b/usr.bin/less/os.c
index 8b10e7f7907..3a18b56f8ab 100644
--- a/usr.bin/less/os.c
+++ b/usr.bin/less/os.c
@@ -56,18 +56,6 @@ start:
}
/*
- * Return the current time.
- */
-long
-get_time(void)
-{
- time_t t;
-
- (void) time(&t);
- return (t);
-}
-
-/*
* errno_message: Return an error message based on the value of "errno".
*/
char *