summaryrefslogtreecommitdiff
path: root/meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0001-Fix-warnings-remove-some-unused-macros.patch
diff options
context:
space:
mode:
authorDexuan Cui <dexuan.cui@intel.com>2012-03-29 00:35:09 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-04-02 04:26:09 +0100
commit8f17e499cf91191727c8767e839738cb39c21655 (patch)
treeff928b8e77c62375328841aaa822a1d95ce5dd04 /meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0001-Fix-warnings-remove-some-unused-macros.patch
parentb3ccc630e6c12a75111b1f7ca877e17d8d4e1dc7 (diff)
downloadopenembedded-core-8f17e499cf91191727c8767e839738cb39c21655.tar.gz
openembedded-core-8f17e499cf91191727c8767e839738cb39c21655.tar.bz2
openembedded-core-8f17e499cf91191727c8767e839738cb39c21655.tar.xz
openembedded-core-8f17e499cf91191727c8767e839738cb39c21655.zip
genext2fs: support large files and filesystems without using large amounts of memory
update_to_1.95.patch was generated by making a diff bewteen the 1.4.1 release and the latest 1.9.5 version in the cvs repo: http://genext2fs.cvs.sourceforge.net/viewvc/genext2fs/genext2fs/genext2fs.c?revision=1.95 The patches 0001-0019 come from mailing list of genext2fs-devel http://sourceforge.net/mailarchive/forum.php?forum_name=genext2fs-devel&max_rows=100&style=flat&viewmonth=201106 Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Diffstat (limited to 'meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0001-Fix-warnings-remove-some-unused-macros.patch')
-rw-r--r--meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0001-Fix-warnings-remove-some-unused-macros.patch72
1 files changed, 72 insertions, 0 deletions
diff --git a/meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0001-Fix-warnings-remove-some-unused-macros.patch b/meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0001-Fix-warnings-remove-some-unused-macros.patch
new file mode 100644
index 000000000..f981b449b
--- /dev/null
+++ b/meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0001-Fix-warnings-remove-some-unused-macros.patch
@@ -0,0 +1,72 @@
+Upstream-Status: inappropriate
+
+From 1399df7672ec309523bcd067da24d72aa624f783 Mon Sep 17 00:00:00 2001
+From: Corey Minyard <cminyard@mvista.com>
+Date: Wed, 1 Jun 2011 07:51:24 -0500
+Subject: [PATCH 01/19] Fix warnings, remove some unused macros.
+
+These are some annoying warnings with newer toolchains. And NAMLEN is
+never used, so just get rid of it.
+---
+ genext2fs.c | 15 +++++++++------
+ 1 files changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/genext2fs.c b/genext2fs.c
+index f0d797d..284862d 100644
+--- a/genext2fs.c
++++ b/genext2fs.c
+@@ -107,10 +107,8 @@
+
+ #if HAVE_DIRENT_H
+ # include <dirent.h>
+-# define NAMLEN(dirent) strlen((dirent)->d_name)
+ #else
+ # define dirent direct
+-# define NAMLEN(dirent) (dirent)->d_namlen
+ # if HAVE_SYS_NDIR_H
+ # include <sys/ndir.h>
+ # endif
+@@ -1441,7 +1439,8 @@ mkfile_fs(filesystem *fs, uint32 parent_nod, const char *name, uint32 mode, size
+ if(!(b = (uint8*)calloc(rndup(size, BLOCKSIZE), 1)))
+ error_msg_and_die("not enough mem to read file '%s'", name);
+ if(f)
+- fread(b, size, 1, f); // FIXME: ugly. use mmap() ...
++ if (fread(b, size, 1, f) != 1) // FIXME: ugly. use mmap() ...
++ error_msg_and_die("fread failed");
+ extend_blk(fs, nod, b, rndup(size, BLOCKSIZE) / BLOCKSIZE);
+ free(b);
+ }
+@@ -1673,7 +1672,9 @@ add2fs_from_dir(filesystem *fs, uint32 this_nod, int squash_uids, int squash_per
+ if(chdir(dent->d_name) < 0)
+ perror_msg_and_die(dent->d_name);
+ add2fs_from_dir(fs, this_nod, squash_uids, squash_perms, fs_timestamp, stats);
+- chdir("..");
++ if (chdir("..") == -1)
++ perror_msg_and_die("..");
++
+ break;
+ default:
+ break;
+@@ -1687,7 +1688,8 @@ add2fs_from_dir(filesystem *fs, uint32 this_nod, int squash_uids, int squash_per
+ if(chdir(dent->d_name) < 0)
+ perror_msg_and_die(name);
+ add2fs_from_dir(fs, nod, squash_uids, squash_perms, fs_timestamp, stats);
+- chdir("..");
++ if (chdir("..") == -1)
++ perror_msg_and_die("..");
+ }
+ continue;
+ }
+@@ -1733,7 +1735,8 @@ add2fs_from_dir(filesystem *fs, uint32 this_nod, int squash_uids, int squash_per
+ if(chdir(dent->d_name) < 0)
+ perror_msg_and_die(name);
+ add2fs_from_dir(fs, nod, squash_uids, squash_perms, fs_timestamp, stats);
+- chdir("..");
++ if (chdir("..") == -1)
++ perror_msg_and_die("..");
+ break;
+ default:
+ error_msg("ignoring entry %s", name);
+--
+1.7.4.1
+