aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/lock
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1998-06-29 17:06:00 +0000
committerBruce Evans <bde@FreeBSD.org>1998-06-29 17:06:00 +0000
commit375557fcad82c55a9d54ef6166bacaf584ad19aa (patch)
tree439be8cc885c997c72cd630617c002e5f59868b6 /usr.bin/lock
parent74b5e3ebd13c11429b0176de24ca2ad1e93926c3 (diff)
downloadsrc-375557fcad82c55a9d54ef6166bacaf584ad19aa.tar.gz
src-375557fcad82c55a9d54ef6166bacaf584ad19aa.zip
Don't assume that time_t is long.
Notes
Notes: svn path=/head/; revision=37262
Diffstat (limited to 'usr.bin/lock')
-rw-r--r--usr.bin/lock/lock.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/lock/lock.c b/usr.bin/lock/lock.c
index 1bbec1dbfb68..786c31ac762b 100644
--- a/usr.bin/lock/lock.c
+++ b/usr.bin/lock/lock.c
@@ -45,7 +45,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)lock.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: lock.c,v 1.4 1997/07/21 12:09:34 charnier Exp $";
#endif /* not lint */
/*
@@ -88,6 +88,7 @@ main(argc, argv)
{
struct passwd *pw;
struct timeval timval;
+ time_t timval_sec;
struct itimerval ntimer, otimer;
struct tm *timp;
int ch, sectimeout, usemine;
@@ -130,7 +131,8 @@ main(argc, argv)
if (gettimeofday(&timval, (struct timezone *)NULL))
err(1, "gettimeofday");
nexttime = timval.tv_sec + (sectimeout * 60);
- timp = localtime(&timval.tv_sec);
+ timval_sec = timval.tv_sec;
+ timp = localtime(&timval_sec);
ap = asctime(timp);
tzn = timp->tm_zone;