[OE-core] [PATCH 3/3] sysvinit: Include sys/sysmacros.h for major/minor definitions on musl too

Khem Raj raj.khem at gmail.com
Mon Jul 22 07:26:54 UTC 2019


Fixes musl issue

implicit declaration of function 'minor' is invalid in C99 [-Wimplicit-function-declaration]
which eventually ends up with a linker error

Signed-off-by: Khem Raj <raj.khem at gmail.com>
---
 ...acros.h-for-major-minor-defines-in-g.patch | 99 ++++++++-----------
 1 file changed, 39 insertions(+), 60 deletions(-)

diff --git a/meta/recipes-core/sysvinit/sysvinit/0001-include-sys-sysmacros.h-for-major-minor-defines-in-g.patch b/meta/recipes-core/sysvinit/sysvinit/0001-include-sys-sysmacros.h-for-major-minor-defines-in-g.patch
index 2575b59b5e..e13ac9d06b 100644
--- a/meta/recipes-core/sysvinit/sysvinit/0001-include-sys-sysmacros.h-for-major-minor-defines-in-g.patch
+++ b/meta/recipes-core/sysvinit/sysvinit/0001-include-sys-sysmacros.h-for-major-minor-defines-in-g.patch
@@ -1,71 +1,50 @@
-From 29c7a529d3bb0c1e20239f885e74c5036f1a908c Mon Sep 17 00:00:00 2001
+From 3c29a86f351ea4827dc445bb8e6cb774543c9be6 Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem at gmail.com>
 Date: Mon, 6 Aug 2018 15:38:58 -0700
-Subject: [PATCH] include sys/sysmacros.h for major/minor defines in glibc
+Subject: [PATCH] include sys/sysmacros.h for major/minor definitions
 
 Signed-off-by: Khem Raj <raj.khem at gmail.com>
 Upstream-Status: Pending
+
 ---
- src/bootlogd.c |   3 +++
- src/bootlogd.o | Bin 58448 -> 60376 bytes
- src/dowall.c   |   3 +++
- src/shutdown.c |   4 +++-
- 4 files changed, 9 insertions(+), 1 deletion(-)
+ src/bootlogd.c   | 1 +
+ src/mountpoint.c | 1 +
+ src/shutdown.c   | 1 +
+ 3 files changed, 3 insertions(+)
 
-Index: sysvinit-2.88dsf/src/bootlogd.c
-===================================================================
---- sysvinit-2.88dsf.orig/src/bootlogd.c
-+++ sysvinit-2.88dsf/src/bootlogd.c
-@@ -53,6 +53,9 @@
- #ifdef __linux__
- #include <sys/mount.h>
- #endif
-+#ifdef __GLIBC__
-+#include <sys/sysmacros.h>
-+#endif
- 
- char *Version = "@(#) bootlogd 2.86 03-Jun-2004 miquels at cistron.nl";
- 
-Index: sysvinit-2.88dsf/src/dowall.c
-===================================================================
---- sysvinit-2.88dsf.orig/src/dowall.c
-+++ sysvinit-2.88dsf/src/dowall.c
-@@ -37,6 +37,9 @@
- #include <signal.h>
- #include <setjmp.h>
- #include <paths.h>
-+#ifdef __GLIBC__
+diff --git a/src/bootlogd.c b/src/bootlogd.c
+index 570d382..68d62f3 100644
+--- a/src/bootlogd.c
++++ b/src/bootlogd.c
+@@ -35,6 +35,7 @@
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/stat.h>
 +#include <sys/sysmacros.h>
-+#endif
+ #include <sys/ioctl.h>
+ #include <sys/utsname.h>
+ #include <time.h>
+diff --git a/src/mountpoint.c b/src/mountpoint.c
+index 9e3dd9c..91f74ed 100644
+--- a/src/mountpoint.c
++++ b/src/mountpoint.c
+@@ -25,6 +25,7 @@
  
- #ifndef _PATH_DEV
- # define _PATH_DEV	"/dev/"
-Index: sysvinit-2.88dsf/src/shutdown.c
-===================================================================
---- sysvinit-2.88dsf.orig/src/shutdown.c
-+++ sysvinit-2.88dsf/src/shutdown.c
-@@ -57,7 +57,9 @@
- #include "reboot.h"
- #include "initreq.h"
- #include "init.h"
--
-+#ifdef __GLIBC__
+ #include <sys/types.h>
+ #include <sys/stat.h>
 +#include <sys/sysmacros.h>
-+#endif
- 
- char *Version = "@(#) shutdown 2.86-1 31-Jul-2004 miquels at cistron.nl";
- 
-Index: sysvinit-2.88dsf/src/mountpoint.c
-===================================================================
---- sysvinit-2.88dsf.orig/src/mountpoint.c
-+++ sysvinit-2.88dsf/src/mountpoint.c
-@@ -32,6 +32,9 @@
- #include <stdarg.h>
- #include <getopt.h>
- #include <stdio.h>
-+#ifdef __GLIBC__
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <string.h>
+diff --git a/src/shutdown.c b/src/shutdown.c
+index 7e997da..17de58d 100644
+--- a/src/shutdown.c
++++ b/src/shutdown.c
+@@ -40,6 +40,7 @@
+ #endif
+ #include <sys/types.h>
+ #include <sys/stat.h>
 +#include <sys/sysmacros.h>
-+#endif
- 
- int dostat(char *path, struct stat *st, int do_lstat, int quiet)
- {
+ #include <sys/wait.h>
+ #include <time.h>
+ #include <string.h>
-- 
2.22.0



More information about the Openembedded-core mailing list