diff options
author | Ewan Mellor <ewan@xensource.com> | 2007-03-23 17:51:24 +0000 |
---|---|---|
committer | Ewan Mellor <ewan@xensource.com> | 2007-03-23 17:51:24 +0000 |
commit | 7984b6bc71576c3224060f1fd376e1da093c9308 (patch) | |
tree | abaa138301e0fdb82ab9638a71ff82088f510994 /tools/libxen/test | |
parent | 7beb8f32c161e9b2493b7c77c158262675fbdec6 (diff) | |
download | xen-7984b6bc71576c3224060f1fd376e1da093c9308.tar.gz xen-7984b6bc71576c3224060f1fd376e1da093c9308.tar.bz2 xen-7984b6bc71576c3224060f1fd376e1da093c9308.zip |
Workaround buggy GCCs wrt strftime.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
Diffstat (limited to 'tools/libxen/test')
-rw-r--r-- | tools/libxen/test/test_bindings.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/libxen/test/test_bindings.c b/tools/libxen/test/test_bindings.c index c709e64867..922518fe8a 100644 --- a/tools/libxen/test/test_bindings.c +++ b/tools/libxen/test/test_bindings.c @@ -573,6 +573,16 @@ static void print_vm_power_state(xen_session *session, xen_vm vm) /** + * 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 *session, xen_vm vm) 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++) |