If we are using a timestamp from the command line, don't pay attention to
the user timezone, use UTC instead (for reproducible builds).
This commit is contained in:
parent
f9f791fd0d
commit
683c28c5f2
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cd9660_conversion.c,v 1.4 2007/03/14 14:11:17 christos Exp $ */
|
||||
/* $NetBSD: cd9660_conversion.c,v 1.5 2017/02/08 21:33:12 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(__RCSID) && !defined(__lint)
|
||||
__RCSID("$NetBSD: cd9660_conversion.c,v 1.4 2007/03/14 14:11:17 christos Exp $");
|
||||
__RCSID("$NetBSD: cd9660_conversion.c,v 1.5 2017/02/08 21:33:12 christos Exp $");
|
||||
#endif /* !__lint */
|
||||
|
||||
|
||||
@ -150,6 +150,9 @@ cd9660_pad_string_spaces(char *str, int len)
|
||||
static char
|
||||
cd9660_compute_gm_offset(time_t tim)
|
||||
{
|
||||
if (stampst.st_ino)
|
||||
return 0;
|
||||
|
||||
struct tm t, gm;
|
||||
|
||||
(void)localtime_r(&tim, &t);
|
||||
@ -173,7 +176,10 @@ cd9660_time_8426(unsigned char *buf, time_t tim)
|
||||
struct tm t;
|
||||
char temp[18];
|
||||
|
||||
(void)localtime_r(&tim, &t);
|
||||
if (stampst.st_ino)
|
||||
(void)gmtime_r(&tim, &t);
|
||||
else
|
||||
(void)localtime_r(&tim, &t);
|
||||
(void)snprintf(temp, sizeof(temp), "%04i%02i%02i%02i%02i%02i%02i",
|
||||
1900+(int)t.tm_year,
|
||||
(int)t.tm_mon+1,
|
||||
@ -192,7 +198,10 @@ cd9660_time_915(unsigned char *buf, time_t tim)
|
||||
{
|
||||
struct tm t;
|
||||
|
||||
(void)localtime_r(&tim, &t);
|
||||
if (stampst.st_ino)
|
||||
(void)gmtime_r(&tim, &t);
|
||||
else
|
||||
(void)localtime_r(&tim, &t);
|
||||
buf[0] = t.tm_year;
|
||||
buf[1] = t.tm_mon+1;
|
||||
buf[2] = t.tm_mday;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: udf.c,v 1.17 2015/06/16 23:04:14 christos Exp $ */
|
||||
/* $NetBSD: udf.c,v 1.18 2017/02/08 21:33:12 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
|
||||
@ -30,7 +30,7 @@
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__RCSID("$NetBSD: udf.c,v 1.17 2015/06/16 23:04:14 christos Exp $");
|
||||
__RCSID("$NetBSD: udf.c,v 1.18 2017/02/08 21:33:12 christos Exp $");
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -290,9 +290,6 @@ udf_update_trackinfo(struct mmc_discinfo *di, struct mmc_trackinfo *ti)
|
||||
void
|
||||
udf_prep_opts(fsinfo_t *fsopts)
|
||||
{
|
||||
struct tm *tm;
|
||||
time_t now;
|
||||
|
||||
const option_t udf_options[] = {
|
||||
OPT_STR('T', "disctype", "disc type (cdrom,dvdrom,bdrom,"
|
||||
"dvdram,bdre,disk,cdr,dvdr,bdr,cdrw,dvdrw)"),
|
||||
@ -330,13 +327,16 @@ udf_prep_opts(fsinfo_t *fsopts)
|
||||
context.max_udf = 0x201; /* 0x250 and 0x260 are not ready */
|
||||
|
||||
/* use user's time zone as default */
|
||||
(void)time(&now);
|
||||
tm = localtime(&now);
|
||||
#ifdef HAVE_STRUCT_TM_TM_GMTOFF
|
||||
context.gmtoff = tm->tm_gmtoff;
|
||||
#else
|
||||
context.gmtoff = 0;
|
||||
if (!stampst.st_ino) {
|
||||
struct tm tm;
|
||||
time_t now;
|
||||
(void)time(&now);
|
||||
(void)localtime_r(&now, &tm);
|
||||
context.gmtoff = tm.tm_gmtoff;
|
||||
} else
|
||||
#endif
|
||||
context.gmtoff = 0;
|
||||
|
||||
/* return info */
|
||||
fsopts->fs_specific = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user