From patchwork Fri Oct 2 16:11:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vagrant Cascadian X-Patchwork-Id: 525630 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id C08B514030F for ; Sat, 3 Oct 2015 02:21:33 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DD9084B867; Fri, 2 Oct 2015 18:21:30 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q5PnDTB0pkK1; Fri, 2 Oct 2015 18:21:30 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 41BAE4B84E; Fri, 2 Oct 2015 18:21:30 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ED3F44B84E for ; Fri, 2 Oct 2015 18:21:27 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AEShA7B077Rh for ; Fri, 2 Oct 2015 18:21:27 +0200 (CEST) X-Greylist: delayed 516 seconds by postgrey-1.34 at theia; Fri, 02 Oct 2015 18:21:23 CEST X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from cascadia.aikidev.net (cascadia.aikidev.net [173.255.214.101]) by theia.denx.de (Postfix) with ESMTP id 9CDBB4B845 for ; Fri, 2 Oct 2015 18:21:22 +0200 (CEST) Received: from localhost (unknown [IPv6:2601:1c2:200:d15e:221a:6ff:fe04:64bd]) (Authenticated sender: vagrant@aikidev.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id ADA383FBAF; Fri, 2 Oct 2015 09:12:44 -0700 (PDT) From: Vagrant Cascadian To: u-boot@lists.denx.de Date: Fri, 2 Oct 2015 09:11:51 -0700 Message-Id: <1443802311-31054-1-git-send-email-vagrant@debian.org> X-Mailer: git-send-email 2.1.4 Cc: Vagrant Cascadian , Tom Rini , Guilherme Maciel Ferreira Subject: [U-Boot] [PATCH] Fix variation in timestamps caused by timezone differences. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Tested-by: Paul Kocialkowski Acked-by: Paul Kocialkowski --- tools/default_image.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/default_image.c b/tools/default_image.c index 18940af..3ed7014 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;