Commit 0219e4bf authored by Vagrant Cascadian's avatar Vagrant Cascadian Committed by Tom Rini

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: default avatarVagrant Cascadian <vagrant@debian.org>
Tested-by: default avatarPaul Kocialkowski <contact@paulk.fr>
Acked-by: default avatarPaul Kocialkowski <contact@paulk.fr>
parent 1fec3c5d
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment