From ddddefa4f84c439757431f9afd7917d1912e7204 Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Tue, 3 Jun 2014 12:18:53 +0100 Subject: Add comment to explain the cast to long --- tbdiff/tbdiff-apply.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tbdiff/tbdiff-apply.c') diff --git a/tbdiff/tbdiff-apply.c b/tbdiff/tbdiff-apply.c index e281d73..edc8d0b 100644 --- a/tbdiff/tbdiff-apply.c +++ b/tbdiff/tbdiff-apply.c @@ -493,6 +493,11 @@ tbd_apply_cmd_symlink_create(FILE *stream) struct timeval tv[2]; gettimeofday(&tv[0], NULL); + + /* We cast to a long here so that on a 32 bit system we get + * the time truncated to a 32 bit value, on a 64 bit system + * the long will remain 64 bits. + */ tv[1].tv_sec = (long) mtime; tv[1].tv_usec = 0; -- cgit v1.2.1