From eb7ff6fb0bddb33991fa44586ac8e2e02019dc97 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Mon, 7 Jan 2013 23:08:13 +0100 Subject: Replace remaining gmtime, localtime by gmtime_r, localtime_r MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows removing of MinGW specific code and improves reentrancy for POSIX hosts. [Removed unused ret variable in qemu_get_timedate() to fix warning: vl.c: In function ‘qemu_get_timedate’: vl.c:451:16: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable] -- Stefan Hajnoczi] Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- block/vvfat.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'block/vvfat.c') diff --git a/block/vvfat.c b/block/vvfat.c index 83706ce556..06e6654824 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -529,13 +529,9 @@ static inline uint8_t fat_chksum(const direntry_t* entry) /* if return_time==0, this returns the fat_date, else the fat_time */ static uint16_t fat_datetime(time_t time,int return_time) { struct tm* t; -#ifdef _WIN32 - t=localtime(&time); /* this is not thread safe */ -#else struct tm t1; t = &t1; localtime_r(&time,t); -#endif if(return_time) return cpu_to_le16((t->tm_sec/2)|(t->tm_min<<5)|(t->tm_hour<<11)); return cpu_to_le16((t->tm_mday)|((t->tm_mon+1)<<5)|((t->tm_year-80)<<9)); -- cgit v1.2.3