summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorVagrant Cascadian <vagrant@debian.org>2015-10-02 09:11:51 -0700
committerTom Rini <trini@konsulko.com>2015-10-11 17:12:12 -0400
commit0219e4bfb4d31aed8bbbcf36b00b92844b9b5eb9 (patch)
treeffb61433bb390ba7138d804a70ddf50604acf6c9 /tools
parent1fec3c5d832d6e0cac10135179016b0640f1a863 (diff)
downloadu-boot-0219e4bfb4d31aed8bbbcf36b00b92844b9b5eb9.tar.gz
Fix variation in timestamps caused by timezone differences.
When building with SOURCE_DATE_EPOCH set, avoid use of mktime in default_image.c, which converts the timestamp into localtime. This causes variation based on timezone when building u-boot.img and u-boot-sunxi-with-spl.bin targets. Signed-off-by: Vagrant Cascadian <vagrant@debian.org> Tested-by: Paul Kocialkowski <contact@paulk.fr> Acked-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'tools')
-rw-r--r--tools/default_image.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/default_image.c b/tools/default_image.c
index 18940af5b5..3ed7014147 100644
--- a/tools/default_image.c
+++ b/tools/default_image.c
@@ -89,7 +89,6 @@ static void image_set_header(void *ptr, struct stat *sbuf, int ifd,
{
uint32_t checksum;
char *source_date_epoch;
- struct tm *time_universal;
time_t time;
image_header_t * hdr = (image_header_t *)ptr;
@@ -103,13 +102,10 @@ static void image_set_header(void *ptr, struct stat *sbuf, int ifd,
if (source_date_epoch != NULL) {
time = (time_t) strtol(source_date_epoch, NULL, 10);
- time_universal = gmtime(&time);
- if (time_universal == NULL) {
+ if (gmtime(&time) == NULL) {
fprintf(stderr, "%s: SOURCE_DATE_EPOCH is not valid\n",
__func__);
time = 0;
- } else {
- time = mktime(time_universal);
}
} else {
time = sbuf->st_mtime;