aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@openwrt.org>2010-12-19 11:43:45 +0000
committerHauke Mehrtens <hauke@openwrt.org>2010-12-19 11:43:45 +0000
commita22fbebb0530c49a284b5b6b8bdf399b28147737 (patch)
treed5f151a0e93e72456aa7dee0cdf1af94a37293c0 /tools
parent722e340ec18b7be2b041259a462fc45ad20ab2d3 (diff)
downloadupstream-a22fbebb0530c49a284b5b6b8bdf399b28147737.tar.gz
upstream-a22fbebb0530c49a284b5b6b8bdf399b28147737.tar.bz2
upstream-a22fbebb0530c49a284b5b6b8bdf399b28147737.zip
e2fsprogs: add two compile fixes.
Thank you Joe Roback for reporting and fixing compiling on Darwin. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@24720 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'tools')
-rw-r--r--tools/e2fsprogs/patches/003-darwin_directio_fix.patch36
-rw-r--r--tools/e2fsprogs/patches/004-big_endian_compile_fix.patch26
2 files changed, 62 insertions, 0 deletions
diff --git a/tools/e2fsprogs/patches/003-darwin_directio_fix.patch b/tools/e2fsprogs/patches/003-darwin_directio_fix.patch
new file mode 100644
index 0000000000..971c7ad99b
--- /dev/null
+++ b/tools/e2fsprogs/patches/003-darwin_directio_fix.patch
@@ -0,0 +1,36 @@
+--- a/lib/ext2fs/unix_io.c
++++ b/lib/ext2fs/unix_io.c
+@@ -428,6 +428,7 @@ static errcode_t unix_open(const char *n
+ struct unix_private_data *data = NULL;
+ errcode_t retval;
+ int open_flags;
++ int f_nocache = 0;
+ struct stat st;
+ #ifdef __linux__
+ struct utsname ut;
+@@ -464,7 +465,11 @@ static errcode_t unix_open(const char *n
+ if (flags & IO_FLAG_EXCLUSIVE)
+ open_flags |= O_EXCL;
+ if (flags & IO_FLAG_DIRECT_IO)
++#if !defined(O_DIRECT) && defined(F_NOCACHE)
++ f_nocache = F_NOCACHE;
++#else
+ open_flags |= O_DIRECT;
++#endif
+ data->flags = flags;
+
+ #ifdef HAVE_OPEN64
+@@ -477,6 +482,13 @@ static errcode_t unix_open(const char *n
+ goto cleanup;
+ }
+
++ if (f_nocache) {
++ if (fcntl(data->dev, f_nocache, 1) < 0) {
++ retval = errno;
++ goto cleanup;
++ }
++ }
++
+ #ifdef BLKSSZGET
+ if (flags & IO_FLAG_DIRECT_IO) {
+ if (ioctl(data->dev, BLKSSZGET, &data->align) != 0)
diff --git a/tools/e2fsprogs/patches/004-big_endian_compile_fix.patch b/tools/e2fsprogs/patches/004-big_endian_compile_fix.patch
new file mode 100644
index 0000000000..9c3e3360e7
--- /dev/null
+++ b/tools/e2fsprogs/patches/004-big_endian_compile_fix.patch
@@ -0,0 +1,26 @@
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Fri, 17 Dec 2010 03:11:43 +0000 (-0500)
+Subject: libext2fs: Fix compile bug on big-endian architectures
+X-Git-Url: http://git.kernel.org/?p=fs%2Fext2%2Fe2fsprogs.git;a=commitdiff_plain;h=9098c986b64bb65a2b7fcd2724a400ba1f451f6b
+
+libext2fs: Fix compile bug on big-endian architectures
+
+Addresses-Sourceforge-Bug: #3138115
+
+Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+---
+
+diff --git a/lib/ext2fs/swapfs.c b/lib/ext2fs/swapfs.c
+index 6f6cec2..12427e0 100644
+--- a/lib/ext2fs/swapfs.c
++++ b/lib/ext2fs/swapfs.c
+@@ -72,7 +72,7 @@ void ext2fs_swap_super(struct ext2_super_block * sb)
+ sb->s_flags = ext2fs_swab32(sb->s_flags);
+ sb->s_kbytes_written = ext2fs_swab64(sb->s_kbytes_written);
+ sb->s_snapshot_inum = ext2fs_swab32(sb->s_snapshot_inum);
+- sb->s_snapshot_id = ext2fs_swab32(s_snapshot_id);
++ sb->s_snapshot_id = ext2fs_swab32(sb->s_snapshot_id);
+ sb->s_snapshot_r_blocks_count =
+ ext2fs_swab64(sb->s_snapshot_r_blocks_count);
+ sb->s_snapshot_list = ext2fs_swab32(sb->s_snapshot_list);
+