mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-11 19:17:22 +00:00
fix byteswapping problem on sparc (and other big endian architectures)
This commit is contained in:
parent
56b892cea1
commit
c13966f04b
@ -1635,9 +1635,10 @@ ipmi_sel_get_time(struct ipmi_intf * intf)
|
|||||||
|
|
||||||
memcpy(&timei, rsp->data, 4);
|
memcpy(&timei, rsp->data, 4);
|
||||||
#if WORDS_BIGENDIAN
|
#if WORDS_BIGENDIAN
|
||||||
timei = BSWAP_32(timei);
|
time = (time_t)(BSWAP_32(timei));
|
||||||
#endif
|
#else
|
||||||
time = (time_t)timei;
|
time = (time_t)timei;
|
||||||
|
#endif
|
||||||
|
|
||||||
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&time));
|
strftime(tbuf, sizeof(tbuf), "%m/%d/%Y %H:%M:%S", localtime(&time));
|
||||||
printf("%s\n", tbuf);
|
printf("%s\n", tbuf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user