Author: markj
Date: Wed Sep 17 00:54:00 2014
New Revision: 271695
URL: http://svnweb.freebsd.org/changeset/base/271695

Log:
  Fix some incorrect endianness checks.
  
  MFC after:    1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c

Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c   Wed Sep 17 
00:30:25 2014        (r271694)
+++ head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c   Wed Sep 17 
00:54:00 2014        (r271695)
@@ -274,7 +274,7 @@ ctf_fdopen(int fd, int *errp)
         */
        if (nbytes >= (ssize_t) sizeof (Elf32_Ehdr) &&
            bcmp(&hdr.e32.e_ident[EI_MAG0], ELFMAG, SELFMAG) == 0) {
-#ifdef _BIG_ENDIAN
+#if BYTE_ORDER == _BIG_ENDIAN
                uchar_t order = ELFDATA2MSB;
 #else
                uchar_t order = ELFDATA2LSB;

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c       Wed Sep 
17 00:30:25 2014        (r271694)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c       Wed Sep 
17 00:54:00 2014        (r271695)
@@ -167,7 +167,7 @@ print_bitfield(dt_printarg_t *pap, ulong
         * to the lowest 'size' bytes in 'value', and we need to shift based on
         * the offset from the end of the data, not the offset of the start.
         */
-#ifdef _BIG_ENDIAN
+#if BYTE_ORDER == _BIG_ENDIAN
        buf += sizeof (value) - size;
        off += ep->cte_bits;
 #endif
@@ -178,7 +178,7 @@ print_bitfield(dt_printarg_t *pap, ulong
         * Offsets are counted from opposite ends on little- and
         * big-endian machines.
         */
-#ifdef _BIG_ENDIAN
+#if BYTE_ORDER == _BIG_ENDIAN
        shift = NBBY - shift;
 #endif
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to