Patchwork [for-1.4] tests: Fix {rtc, m48t59}-test build on illumos

login
register
mail settings
Submitter Andreas Färber
Date Jan. 26, 2013, 2:27 p.m.
Message ID <1359210479-12807-1-git-send-email-andreas.faerber@web.de>
Download mbox | patch
Permalink /patch/215911/
State New
Headers show

Comments

Andreas Färber - Jan. 26, 2013, 2:27 p.m.
Struct tm does not have tm_gmtoff field on illumos.
Fix the build by not zero-initializing these fields on Solaris.

Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
 tests/m48t59-test.c |    2 ++
 tests/rtc-test.c    |    2 ++
 2 Dateien geändert, 4 Zeilen hinzugefügt(+)
Stefan Hajnoczi - Jan. 30, 2013, 10:18 a.m.
On Sat, Jan 26, 2013 at 03:27:59PM +0100, Andreas Färber wrote:
> Struct tm does not have tm_gmtoff field on illumos.
> Fix the build by not zero-initializing these fields on Solaris.
> 
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Andreas Färber <andreas.faerber@web.de>
> ---
>  tests/m48t59-test.c |    2 ++
>  tests/rtc-test.c    |    2 ++
>  2 Dateien geändert, 4 Zeilen hinzugefügt(+)

Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches

Stefan

Patch

diff --git a/tests/m48t59-test.c b/tests/m48t59-test.c
index d79f554..77d69b3 100644
--- a/tests/m48t59-test.c
+++ b/tests/m48t59-test.c
@@ -142,7 +142,9 @@  static void cmos_get_date_time(struct tm *date)
     date->tm_mday = mday;
     date->tm_mon = mon - 1;
     date->tm_year = base_year + year - 1900;
+#ifndef __sun__
     date->tm_gmtoff = 0;
+#endif
 
     ts = mktime(date);
 }
diff --git a/tests/rtc-test.c b/tests/rtc-test.c
index e7123ca..203c0fc 100644
--- a/tests/rtc-test.c
+++ b/tests/rtc-test.c
@@ -115,7 +115,9 @@  static void cmos_get_date_time(struct tm *date)
     date->tm_mday = mday;
     date->tm_mon = mon - 1;
     date->tm_year = base_year + year - 1900;
+#ifndef __sun__
     date->tm_gmtoff = 0;
+#endif
 
     ts = mktime(date);
 }