From c13966f04b3db14c64221eec1b80503840ea4e27 Mon Sep 17 00:00:00 2001 From: John Blair Date: Mon, 5 Mar 2007 05:16:02 +0000 Subject: [PATCH] fix byteswapping problem on sparc (and other big endian architectures) --- ipmitool/lib/ipmi_sel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ipmitool/lib/ipmi_sel.c b/ipmitool/lib/ipmi_sel.c index 4895fe8..04c14b8 100644 --- a/ipmitool/lib/ipmi_sel.c +++ b/ipmitool/lib/ipmi_sel.c @@ -1635,9 +1635,10 @@ ipmi_sel_get_time(struct ipmi_intf * intf) memcpy(&timei, rsp->data, 4); #if WORDS_BIGENDIAN - timei = BSWAP_32(timei); -#endif + time = (time_t)(BSWAP_32(timei)); +#else time = (time_t)timei; +#endif strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&time)); printf("%s\n", tbuf);