diff options
author | jb <jb@FreeBSD.org> | 1998-02-20 05:08:53 +0000 |
---|---|---|
committer | jb <jb@FreeBSD.org> | 1998-02-20 05:08:53 +0000 |
commit | 46dfb7f7cd6fe9eecacce7e586125f2264dc3524 (patch) | |
tree | 06382ce6cc79fae5a92c0740e083e268cab8e8b7 | |
parent | 7295fb5707b5be5dc3721f7d7e82f790990ccb44 (diff) | |
download | FreeBSD-src-46dfb7f7cd6fe9eecacce7e586125f2264dc3524.zip FreeBSD-src-46dfb7f7cd6fe9eecacce7e586125f2264dc3524.tar.gz |
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.
-rw-r--r-- | usr.bin/fetch/util.c | 6 |
1 files changed, 4 insertions, 2 deletions
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 <sys/types.h> @@ -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); } |