i2cdev: Include libgen.h on musl

This helps in getting prototype for basename() and fix build errors
on clang-18+

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj 2024-03-25 18:13:59 -07:00
parent 10fb90ef3c
commit 2de9cb6ec7
No known key found for this signature in database
GPG Key ID: BB053355919D3314

View File

@ -20,8 +20,6 @@ Upstream-Status: Submitted [https://github.com/costad2/i2cdev/pull/5]
lsi2c/lsi2c.c | 4 ++--
7 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/libi2cdev/access.c b/libi2cdev/access.c
index 62a3f59..2e77659 100644
--- a/libi2cdev/access.c
+++ b/libi2cdev/access.c
@@ -16,7 +16,6 @@
@ -32,20 +30,19 @@ index 62a3f59..2e77659 100644
#include "sysfs.h"
#include "i2cdiscov.h"
diff --git a/libi2cdev/i2c-bus-parser.c b/libi2cdev/i2c-bus-parser.c
index c4b8688..8c760e0 100644
--- a/libi2cdev/i2c-bus-parser.c
+++ b/libi2cdev/i2c-bus-parser.c
@@ -27,7 +27,6 @@
@@ -27,9 +27,9 @@
#include <dirent.h>
#include <fcntl.h>
#include <errno.h>
-#include <error.h>
#include <alloca.h>
#include <search.h>
+#include <libgen.h>
diff --git a/libi2cdev/i2c-dev-path.c b/libi2cdev/i2c-dev-path.c
index b156db7..361761c 100644
#include "common.h"
#include "sysfs.h"
--- a/libi2cdev/i2c-dev-path.c
+++ b/libi2cdev/i2c-dev-path.c
@@ -11,7 +11,6 @@
@ -56,8 +53,6 @@ index b156db7..361761c 100644
#include <linux/limits.h>
diff --git a/libi2cdev/i2c-error.c b/libi2cdev/i2c-error.c
index f92fb6b..540c112 100644
--- a/libi2cdev/i2c-error.c
+++ b/libi2cdev/i2c-error.c
@@ -9,7 +9,6 @@
@ -68,8 +63,6 @@ index f92fb6b..540c112 100644
#include <errno.h>
#include <stdbool.h>
#include <stdarg.h>
diff --git a/libi2cdev/init.c b/libi2cdev/init.c
index 99a7edd..dfc4090 100644
--- a/libi2cdev/init.c
+++ b/libi2cdev/init.c
@@ -16,10 +16,8 @@
@ -83,20 +76,18 @@ index 99a7edd..dfc4090 100644
#include <fcntl.h>
#include <assert.h>
diff --git a/libi2cdev/sysfs.c b/libi2cdev/sysfs.c
index 2811500..a7e13a8 100644
--- a/libi2cdev/sysfs.c
+++ b/libi2cdev/sysfs.c
@@ -17,7 +17,6 @@
@@ -17,8 +17,8 @@
#include <assert.h>
#include <string.h>
#include <fcntl.h>
-#include <error.h>
#include <errno.h>
+#include <libgen.h>
#include <sys/types.h>
diff --git a/lsi2c/lsi2c.c b/lsi2c/lsi2c.c
index 7af5313..34c6225 100644
#include <sys/stat.h>
--- a/lsi2c/lsi2c.c
+++ b/lsi2c/lsi2c.c
@@ -38,7 +38,6 @@
@ -107,7 +98,7 @@ index 7af5313..34c6225 100644
#include <getopt.h>
#include <stdbool.h>
@@ -205,7 +204,8 @@ static int read_config_file(const char *config_file_name)
@@ -205,7 +204,8 @@ static int read_config_file(const char *
if (err < 0) {
err = -err;
}
@ -117,6 +108,3 @@ index 7af5313..34c6225 100644
if (config_file) {
fclose(config_file);
}
--
2.34.1