mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47: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);
|
||||
#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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user