ia64/xen-unstable

changeset 14542:0810daf7206e

Workaround buggy GCCs wrt strftime.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Fri Mar 23 17:51:24 2007 +0000 (2007-03-23)
parents 94943f2e1de9
children b37006439a53
files tools/libxen/test/test_bindings.c
line diff
     1.1 --- a/tools/libxen/test/test_bindings.c	Fri Mar 23 17:50:18 2007 +0000
     1.2 +++ b/tools/libxen/test/test_bindings.c	Fri Mar 23 17:51:24 2007 +0000
     1.3 @@ -573,6 +573,16 @@ static void print_vm_power_state(xen_ses
     1.4  
     1.5  
     1.6  /**
     1.7 + * Workaround for whinging GCCs, as suggested by strftime(3).
     1.8 + */
     1.9 +static size_t my_strftime(char *s, size_t max, const char *fmt,
    1.10 +                          const struct tm *tm)
    1.11 +{
    1.12 +    return strftime(s, max, fmt, tm);
    1.13 +}
    1.14 +
    1.15 +
    1.16 +/**
    1.17   * Print the metrics for the given VM.
    1.18   */
    1.19  static void print_vm_metrics(xen_session *session, xen_vm vm)
    1.20 @@ -594,7 +604,7 @@ static void print_vm_metrics(xen_session
    1.21  
    1.22      char time[256];
    1.23      struct tm *tm = localtime(&vm_metrics_record->last_updated);
    1.24 -    strftime(time, 256, "Metrics updated at %c, local time.\n", tm);
    1.25 +    my_strftime(time, 256, "Metrics updated at %c, local time.\n", tm);
    1.26      printf(time);
    1.27  
    1.28      for (size_t i = 0; i < vm_metrics_record->vcpus_utilisation->size; i++)