[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Workaround buggy GCCs wrt strftime.



# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1174672284 0
# Node ID 0810daf7206e603c9fee1decfc9f446626b5772c
# Parent  94943f2e1de990fb1f73a801b8e266a928a574c5
Workaround buggy GCCs wrt strftime.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/libxen/test/test_bindings.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletion(-)

diff -r 94943f2e1de9 -r 0810daf7206e tools/libxen/test/test_bindings.c
--- a/tools/libxen/test/test_bindings.c Fri Mar 23 17:50:18 2007 +0000
+++ b/tools/libxen/test/test_bindings.c Fri Mar 23 17:51:24 2007 +0000
@@ -573,6 +573,16 @@ static void print_vm_power_state(xen_ses
 
 
 /**
+ * Workaround for whinging GCCs, as suggested by strftime(3).
+ */
+static size_t my_strftime(char *s, size_t max, const char *fmt,
+                          const struct tm *tm)
+{
+    return strftime(s, max, fmt, tm);
+}
+
+
+/**
  * Print the metrics for the given VM.
  */
 static void print_vm_metrics(xen_session *session, xen_vm vm)
@@ -594,7 +604,7 @@ static void print_vm_metrics(xen_session
 
     char time[256];
     struct tm *tm = localtime(&vm_metrics_record->last_updated);
-    strftime(time, 256, "Metrics updated at %c, local time.\n", tm);
+    my_strftime(time, 256, "Metrics updated at %c, local time.\n", tm);
     printf(time);
 
     for (size_t i = 0; i < vm_metrics_record->vcpus_utilisation->size; i++)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.