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.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'block.c') diff --git a/block.c b/block.c index 4e28c55bc7..60873eafea 100644 --- a/block.c +++ b/block.c @@ -3338,11 +3338,7 @@ char *get_human_readable_size(char *buf, int buf_size, int64_t size) char *bdrv_snapshot_dump(char *buf, int buf_size, QEMUSnapshotInfo *sn) { char buf1[128], date_buf[128], clock_buf[128]; -#ifdef _WIN32 - struct tm *ptm; -#else struct tm tm; -#endif time_t ti; int64_t secs; @@ -3352,15 +3348,9 @@ char *bdrv_snapshot_dump(char *buf, int buf_size, QEMUSnapshotInfo *sn) "ID", "TAG", "VM SIZE", "DATE", "VM CLOCK"); } else { ti = sn->date_sec; -#ifdef _WIN32 - ptm = localtime(&ti); - strftime(date_buf, sizeof(date_buf), - "%Y-%m-%d %H:%M:%S", ptm); -#else localtime_r(&ti, &tm); strftime(date_buf, sizeof(date_buf), "%Y-%m-%d %H:%M:%S", &tm); -#endif secs = sn->vm_clock_nsec / 1000000000; snprintf(clock_buf, sizeof(clock_buf), "%02d:%02d:%02d.%03d", -- cgit v1.2.1