buildroot/package/android-tools/0008-usb_linux.c-fix-minor-...

60 lines
1.6 KiB
Diff

From 99c20bd08065d9c78d81ba7aa48a2a113ab28c26 Mon Sep 17 00:00:00 2001
From: Giulio Benetti <giulio.benetti@micronovasrl.com>
Date: Sun, 1 Dec 2024 15:46:50 +0100
Subject: [PATCH] usb_linux.c: fix minor()/major() build failure due to glibc
2.28
glibc 2.28 no longer includes <sys/sysmacros.h> from <sys/types.h>,
and therefore <sys/sysmacros.h> must be included explicitly when
major()/minor() are used.
This commit adds a patch to directly include <sys/sysmacros.h> into
all usb_linux.c files where minor() and major() macros are used.
Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
---
core/adb/usb_linux.c | 1 +
core/adbd/usb_linux.c | 1 +
core/fastboot/usb_linux.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/core/adb/usb_linux.c b/core/adb/usb_linux.c
index 7bf2057..f748267 100644
--- a/core/adb/usb_linux.c
+++ b/core/adb/usb_linux.c
@@ -20,6 +20,7 @@
#include <string.h>
#include <sys/ioctl.h>
+#include <sys/sysmacros.h>
#include <sys/types.h>
#include <sys/time.h>
#include <dirent.h>
diff --git a/core/adbd/usb_linux.c b/core/adbd/usb_linux.c
index 7bf2057..f748267 100644
--- a/core/adbd/usb_linux.c
+++ b/core/adbd/usb_linux.c
@@ -20,6 +20,7 @@
#include <string.h>
#include <sys/ioctl.h>
+#include <sys/sysmacros.h>
#include <sys/types.h>
#include <sys/time.h>
#include <dirent.h>
diff --git a/core/fastboot/usb_linux.c b/core/fastboot/usb_linux.c
index b7a9ca3..2dac62b 100644
--- a/core/fastboot/usb_linux.c
+++ b/core/fastboot/usb_linux.c
@@ -33,6 +33,7 @@
#include <sys/ioctl.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
#include <sys/types.h>
#include <dirent.h>
#include <fcntl.h>
--
2.47.0