]> git.proxmox.com Git - mirror_qemu.git/blobdiff - savevm.c
Fix OpenBSD build warning
[mirror_qemu.git] / savevm.c
index 4d9f822f27cc7a14f766ec378308a1bd70a293ba..6fa7a5fe8e41ae1039754287c059ddb66d06c3f2 100644 (file)
--- a/savevm.c
+++ b/savevm.c
@@ -1897,7 +1897,8 @@ void do_savevm(Monitor *mon, const QDict *qdict)
         ptm = localtime(&tb.time);
         strftime(sn->name, sizeof(sn->name), "vm-%Y%m%d%H%M%S", ptm);
 #else
-        localtime_r(&tv.tv_sec, &tm);
+        /* cast below needed for OpenBSD where tv_sec is still 'long' */
+        localtime_r((const time_t *)&tv.tv_sec, &tm);
         strftime(sn->name, sizeof(sn->name), "vm-%Y%m%d%H%M%S", &tm);
 #endif
     }