From 5d601a9b1c3fb8522e6766a62d60b08d9fd2a8da Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 30 Nov 2014 20:56:44 +0000 Subject: [PATCH] xfs2: auto-switch endianness and fix build bug --- Standalone/xfs2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Standalone/xfs2.c b/Standalone/xfs2.c index 7ce06577..68207deb 100644 --- a/Standalone/xfs2.c +++ b/Standalone/xfs2.c @@ -900,7 +900,7 @@ blkno_t bmap(inoptr ip, blkno_t bn, int rwflg) } ******/ i = (bn>>sh) & 0xff; - if ((swizzle16(nb) = ((blkno_t *)bp)[i])) + if ((swizzle16(nb) == ((blkno_t *)bp)[i])) brelse(bp); else { @@ -1024,6 +1024,8 @@ int fmount(int dev, inoptr ino) brelse((bufptr)buf); /* See if there really is a filesystem on the device */ + if (fp->s_mounted == SMOUNTED_WRONGENDIAN) + swizzling = 1; if (swizzle16(fp->s_mounted) != SMOUNTED || swizzle16(fp->s_isize) >= swizzle16(fp->s_fsize)) return (-1); -- 2.34.1