Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/dist/common/nvpair Replace the Solaris s...



details:   https://anonhg.NetBSD.org/src/rev/2c81c05d967b
branches:  trunk
changeset: 379229:2c81c05d967b
user:      hannken <hannken%NetBSD.org@localhost>
date:      Fri May 21 17:32:49 2021 +0000

description:
Replace the Solaris style endian check (exactly one of
_LITTLE_ENDIAN or _BIG_ENDIAN is defined) with standard check
"#if BYTE_ORDER == BIG_ENDIAN" like we do it elseware.

Should fix PR 56191 (ZFS tests fail on sparc64)

diffstat:

 external/cddl/osnet/dist/common/nvpair/nvpair.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (19 lines):

diff -r d7de67a10c2a -r 2c81c05d967b external/cddl/osnet/dist/common/nvpair/nvpair.c
--- a/external/cddl/osnet/dist/common/nvpair/nvpair.c   Fri May 21 11:28:11 2021 +0000
+++ b/external/cddl/osnet/dist/common/nvpair/nvpair.c   Fri May 21 17:32:49 2021 +0000
@@ -2255,11 +2255,11 @@ nvlist_common(nvlist_t *nvl, char *buf, 
        int err = 0;
        nvstream_t nvs;
        int nvl_endian;
-#ifdef _LITTLE_ENDIAN
-       int host_endian = 1;
+#if BYTE_ORDER == BIG_ENDIAN
+       int host_endian = 0;
 #else
-       int host_endian = 0;
-#endif /* _LITTLE_ENDIAN */
+       int host_endian = 1;
+#endif /* BYTE_ORDER */
        nvs_header_t *nvh = (void *)buf;
 
        if (buflen == NULL || nvl == NULL ||



Home | Main Index | Thread Index | Old Index