Whamcloud - gitweb
LU-6535 utils: fix updating index and fsname
[fs/lustre-release.git] / lustre / utils / llog_reader.c
index c58f26b..fed31ee 100644 (file)
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <endian.h>
+#ifdef HAVE_ENDIAN_H
+# include <endian.h>
+#endif
+#include <unistd.h>
 #include <fcntl.h>
 
 #include <time.h>
@@ -55,7 +58,9 @@ static inline int ext2_test_bit(int nr, const void *addr)
        const unsigned char *tmp = addr;
        return (tmp[nr >> 3] >> (nr & 7)) & 1;
 #else
-       return test_bit(nr, addr);
+       const unsigned long *tmp = addr;
+       return ((1UL << (nr & (BITS_PER_LONG - 1))) &
+               ((tmp)[nr / BITS_PER_LONG])) != 0;
 #endif
 }