X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/68e5672a7d43a81e7feec8b9191d6ee174ca24af..c0ade48327ba560509bce52b7e22b2225dd50475:/tools/mtd-utils/patches/110-portability.patch diff --git a/tools/mtd-utils/patches/110-portability.patch b/tools/mtd-utils/patches/110-portability.patch index d35b44658..5bf1b95bc 100644 --- a/tools/mtd-utils/patches/110-portability.patch +++ b/tools/mtd-utils/patches/110-portability.patch @@ -1,23 +1,23 @@ --- a/compr_lzo.c +++ b/compr_lzo.c -@@ -24,7 +24,6 @@ - #include - #include +@@ -26,7 +26,6 @@ #include + + #ifndef WITHOUT_LZO -#include #include #include #include "compr.h" --- a/compr_zlib.c +++ b/compr_zlib.c -@@ -35,7 +35,6 @@ - #include +@@ -39,7 +39,6 @@ #include + #undef crc32 #include -#include #include + #include "common.h" #include "compr.h" - --- a/rbtree.h +++ b/rbtree.h @@ -94,8 +94,7 @@ static inline struct page * rb_insert_pa @@ -30,16 +30,6 @@ struct rb_node { -@@ -131,7 +130,9 @@ static inline void rb_set_color(struct r - - #define RB_ROOT (struct rb_root) { NULL, } - -+#ifndef offsetof - #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) -+#endif - - #define container_of(ptr, type, member) ({ \ - const typeof( ((type *)0)->member ) *__mptr = (ptr); \ --- a/include/mtd/ubi-media.h +++ b/include/mtd/ubi-media.h @@ -30,7 +30,15 @@ @@ -77,7 +67,7 @@ #include --- a/mkfs.ubifs/mkfs.ubifs.c +++ b/mkfs.ubifs/mkfs.ubifs.c -@@ -773,8 +773,8 @@ int write_leb(int lnum, int len, void *b +@@ -821,8 +821,8 @@ int write_leb(int lnum, int len, void *b if (ubi_leb_change_start(ubi, out_fd, lnum, c->leb_size, dtype)) return sys_err_msg("ubi_leb_change_start failed"); @@ -88,7 +78,7 @@ (long long)pos); if (write(out_fd, buf, c->leb_size) != c->leb_size) -@@ -1029,6 +1029,7 @@ static int add_inode_with_data(struct st +@@ -1079,6 +1079,7 @@ static int add_inode_with_data(struct st if (c->default_compr != UBIFS_COMPR_NONE) use_flags |= UBIFS_COMPR_FL; @@ -96,7 +86,7 @@ if (flags & FS_COMPR_FL) use_flags |= UBIFS_COMPR_FL; if (flags & FS_SYNC_FL) -@@ -1039,6 +1040,7 @@ static int add_inode_with_data(struct st +@@ -1089,6 +1090,7 @@ static int add_inode_with_data(struct st use_flags |= UBIFS_APPEND_FL; if (flags & FS_DIRSYNC_FL && S_ISDIR(st->st_mode)) use_flags |= UBIFS_DIRSYNC_FL; @@ -104,7 +94,7 @@ memset(ino, 0, UBIFS_INO_NODE_SZ); -@@ -1108,7 +1110,9 @@ static int add_dir_inode(DIR *dir, ino_t +@@ -1158,7 +1160,9 @@ static int add_dir_inode(DIR *dir, ino_t fd = dirfd(dir); if (fd == -1) return sys_err_msg("dirfd failed"); @@ -114,7 +104,7 @@ flags = 0; } -@@ -1293,10 +1297,12 @@ static int add_file(const char *path_nam +@@ -1343,10 +1347,12 @@ static int add_file(const char *path_nam key_write(&key, &dn->key); dn->size = cpu_to_le32(bytes_read); out_len = NODE_BUFFER_SIZE - UBIFS_DATA_NODE_SZ; @@ -127,7 +117,7 @@ use_compr = c->default_compr; compr_type = compress_data(buf, bytes_read, &dn->data, &out_len, use_compr); -@@ -1338,7 +1344,9 @@ static int add_non_dir(const char *path_ +@@ -1388,7 +1394,9 @@ static int add_non_dir(const char *path_ if (fd == -1) return sys_err_msg("failed to open file '%s'", path_name);