Skip to content

Commit

Permalink
Fix compilation with glibc 2.25+
Browse files Browse the repository at this point in the history
From glibc 2.25 release notes:

The inclusion of <sys/sysmacros.h> by <sys/types.h> is deprecated.
This means that in a future release, the macros "major", "minor", and
"makedev" will only be available from <sys/sysmacros.h>

https://sourceware.org/ml/libc-alpha/2017-02/msg00079.html
  • Loading branch information
kfp committed Apr 21, 2019
1 parent 7a29a78 commit 2499b66
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
1 change: 1 addition & 0 deletions release/src-rt-5.02hnd/hostTools/jffs2/mkfs.jffs2.c
Expand Up @@ -49,6 +49,7 @@

#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/sysmacros.h>
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
Expand Down
66 changes: 66 additions & 0 deletions release/src-rt-5.02hnd/hostTools/mtd-utils-20090606.patch
Expand Up @@ -64,3 +64,69 @@ diff -ur mtd-utils-20090606_orig/mkfs.ubifs/hashtable/hashtable_itr.h mtd-utils-
hashtable_iterator_value(struct hashtable_itr *i)
{
return i->e->v;
diff -ur mtd-utils-20090606.orig/mkfs.jffs2.c ./mtd-utils-20090606/mkfs.jffs2.c
--- ./mtd-utils-20090606.orig/mkfs.jffs2.c 2009-06-05 16:41:47.000000000 +0000
+++ ./mtd-utils-20090606/mkfs.jffs2.c 2019-04-14 07:24:58.857349884 +0000
@@ -51,6 +51,7 @@
#include <sys/types.h>
#include <stdio.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
#include <unistd.h>
#include <sys/mman.h>
#include <fcntl.h>
diff -ur mtd-utils-20090606.orig/mkfs.ubifs/mkfs.ubifs.h ./mtd-utils-20090606/mkfs.ubifs/mkfs.ubifs.h
--- ./mtd-utils-20090606.orig/mkfs.ubifs/mkfs.ubifs.h 2009-06-05 16:41:47.000000000 +0000
+++ ./mtd-utils-20090606/mkfs.ubifs/mkfs.ubifs.h 2019-04-14 07:24:58.860683215 +0000
@@ -39,6 +39,7 @@
#include <getopt.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <dirent.h>
diff -ur mtd-utils-20090606.orig/ubi-utils/old-utils/src/libubi.c ./mtd-utils-20090606/ubi-utils/old-utils/src/libubi.c
--- ./mtd-utils-20090606.orig/ubi-utils/old-utils/src/libubi.c 2009-06-05 16:41:47.000000000 +0000
+++ ./mtd-utils-20090606/ubi-utils/old-utils/src/libubi.c 2019-04-14 07:24:58.880683200 +0000
@@ -25,6 +25,7 @@
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
diff -ur mtd-utils-20090606.orig/ubi-utils/src/libmtd.c ./mtd-utils-20090606/ubi-utils/src/libmtd.c
--- ./mtd-utils-20090606.orig/ubi-utils/src/libmtd.c 2009-06-05 16:41:47.000000000 +0000
+++ ./mtd-utils-20090606/ubi-utils/src/libmtd.c 2019-04-14 07:24:58.884016531 +0000
@@ -30,6 +30,7 @@
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
#include <sys/ioctl.h>
#include <mtd/mtd-user.h>

diff -ur mtd-utils-20090606.orig/ubi-utils/src/libmtd_legacy.c ./mtd-utils-20090606/ubi-utils/src/libmtd_legacy.c
--- ./mtd-utils-20090606.orig/ubi-utils/src/libmtd_legacy.c 2009-06-05 16:41:47.000000000 +0000
+++ ./mtd-utils-20090606/ubi-utils/src/libmtd_legacy.c 2019-04-14 07:24:58.884016531 +0000
@@ -30,6 +30,7 @@
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
#include <sys/ioctl.h>
#include <mtd/mtd-user.h>

diff -ur mtd-utils-20090606.orig/ubi-utils/src/libubi.c ./mtd-utils-20090606/ubi-utils/src/libubi.c
--- ./mtd-utils-20090606.orig/ubi-utils/src/libubi.c 2009-06-05 16:41:47.000000000 +0000
+++ ./mtd-utils-20090606/ubi-utils/src/libubi.c 2019-04-14 07:24:58.887349862 +0000
@@ -29,6 +29,7 @@
#include <limits.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
#include <sys/types.h>
#include <libubi.h>
#include "libubi_int.h"
1 change: 1 addition & 0 deletions release/src-rt-5.02hnd/hostTools/squashfs_4.2/mksquashfs.c
Expand Up @@ -33,6 +33,7 @@
#include <stddef.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/sysmacros.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
Expand Down
1 change: 1 addition & 0 deletions release/src-rt-5.02hnd/hostTools/squashfs_4.2/unsquashfs.c
Expand Up @@ -31,6 +31,7 @@

#include <sys/sysinfo.h>
#include <sys/types.h>
#include <sys/sysmacros.h>

struct cache *fragment_cache, *data_cache;
struct queue *to_reader, *to_deflate, *to_writer, *from_writer;
Expand Down

0 comments on commit 2499b66

Please sign in to comment.