1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 05:09:24 +00:00

sysvinit: Include sys/sysmacros.h for major/minor definitions on musl too

Fixes musl issue

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

(From OE-Core rev: 6b603924e50a5694421b9142494315799422928d)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Khem Raj
2019-07-22 00:26:54 -07:00
committed by Richard Purdie
parent bbd5d098ec
commit f24ef905ed
@@ -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@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@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(-)
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>
---
src/bootlogd.c | 1 +
src/mountpoint.c | 1 +
src/shutdown.c | 1 +
3 files changed, 3 insertions(+)
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>
#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 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
#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
+#ifdef __GLIBC__
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
+#endif
char *Version = "@(#) bootlogd 2.86 03-Jun-2004 miquels@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__
+#include <sys/sysmacros.h>
+#endif
#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/sysmacros.h>
+#endif
char *Version = "@(#) shutdown 2.86-1 31-Jul-2004 miquels@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 <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>