From 46dfb7f7cd6fe9eecacce7e586125f2264dc3524 Mon Sep 17 00:00:00 2001 From: jb Date: Fri, 20 Feb 1998 05:08:53 +0000 Subject: time() needs a pointer to a time_t, but tv_sec in a timeval is a long (yuk). So give time() what it wants and let the compiler promote the variable when it is assigned to tv_sec. --- usr.bin/fetch/util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/fetch/util.c b/usr.bin/fetch/util.c index 49c1108..1a92762 100644 --- a/usr.bin/fetch/util.c +++ b/usr.bin/fetch/util.c @@ -26,7 +26,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: util.c,v 1.4 1997/02/07 17:55:01 wollman Exp $ + * $Id: util.c,v 1.5 1997/02/11 20:46:06 wollman Exp $ */ #include @@ -89,13 +89,15 @@ void adjmodtime(struct fetch_state *fs) { struct timeval tv[2]; + time_t tt; /* XXX - not strictly correct, since (time_t)-1 does not have to be > 0. This also catches some of the other routines which erroneously return 0 for invalid times rather than -1. */ if (!fs->fs_newtime && fs->fs_modtime > 0) { tv[0].tv_usec = tv[1].tv_usec = 0; - time(&tv[0].tv_sec); + time(&tt); + tv[0].tv_sec = tt; tv[1].tv_sec = fs->fs_modtime; utimes(fs->fs_outputfile, tv); } -- cgit v1.1