diff options
Diffstat (limited to 'e2fsprogs/ext2fs/ext_attr.c')
-rw-r--r-- | e2fsprogs/ext2fs/ext_attr.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/e2fsprogs/ext2fs/ext_attr.c b/e2fsprogs/ext2fs/ext_attr.c index 10b8bfd9d..17610a914 100644 --- a/e2fsprogs/ext2fs/ext_attr.c +++ b/e2fsprogs/ext2fs/ext_attr.c | |||
@@ -12,15 +12,12 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <stdio.h> | 14 | #include <stdio.h> |
15 | #if HAVE_UNISTD_H | ||
16 | #include <unistd.h> | 15 | #include <unistd.h> |
17 | #endif | ||
18 | #include <string.h> | 16 | #include <string.h> |
19 | #include <time.h> | 17 | #include <time.h> |
20 | 18 | ||
21 | #include "ext2_fs.h" | 19 | #include "ext2_fs.h" |
22 | #include "ext2_ext_attr.h" | 20 | #include "ext2_ext_attr.h" |
23 | |||
24 | #include "ext2fs.h" | 21 | #include "ext2fs.h" |
25 | 22 | ||
26 | errcode_t ext2fs_read_ext_attr(ext2_filsys fs, blk_t block, void *buf) | 23 | errcode_t ext2fs_read_ext_attr(ext2_filsys fs, blk_t block, void *buf) |
@@ -30,7 +27,7 @@ errcode_t ext2fs_read_ext_attr(ext2_filsys fs, blk_t block, void *buf) | |||
30 | retval = io_channel_read_blk(fs->io, block, 1, buf); | 27 | retval = io_channel_read_blk(fs->io, block, 1, buf); |
31 | if (retval) | 28 | if (retval) |
32 | return retval; | 29 | return retval; |
33 | #ifdef EXT2FS_ENABLE_SWAPFS | 30 | #if BB_BIG_ENDIAN |
34 | if ((fs->flags & (EXT2_FLAG_SWAP_BYTES| | 31 | if ((fs->flags & (EXT2_FLAG_SWAP_BYTES| |
35 | EXT2_FLAG_SWAP_BYTES_READ)) != 0) | 32 | EXT2_FLAG_SWAP_BYTES_READ)) != 0) |
36 | ext2fs_swap_ext_attr(buf, buf, fs->blocksize, 1); | 33 | ext2fs_swap_ext_attr(buf, buf, fs->blocksize, 1); |
@@ -44,7 +41,7 @@ errcode_t ext2fs_write_ext_attr(ext2_filsys fs, blk_t block, void *inbuf) | |||
44 | char *write_buf; | 41 | char *write_buf; |
45 | char *buf = NULL; | 42 | char *buf = NULL; |
46 | 43 | ||
47 | #ifdef EXT2FS_ENABLE_SWAPFS | 44 | #if BB_BIG_ENDIAN |
48 | if ((fs->flags & EXT2_FLAG_SWAP_BYTES) || | 45 | if ((fs->flags & EXT2_FLAG_SWAP_BYTES) || |
49 | (fs->flags & EXT2_FLAG_SWAP_BYTES_WRITE)) { | 46 | (fs->flags & EXT2_FLAG_SWAP_BYTES_WRITE)) { |
50 | retval = ext2fs_get_mem(fs->blocksize, &buf); | 47 | retval = ext2fs_get_mem(fs->blocksize, &buf); |