1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-03 09:00:21 +00:00

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.
This commit is contained in:
John Birrell 1998-02-20 05:08:53 +00:00
parent 56d73492e1
commit 2ffc763234
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=33653

View File

@ -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);
}