From 070ed35ac5cef8138ed4760582bb72e8d3e136e2 Mon Sep 17 00:00:00 2001
From: Arkadiusz Bokowy <arkadiusz.bokowy@gmail.com>
Date: Sun, 25 Aug 2024 08:42:39 +0200
Subject: [PATCH] Fix compilation on strict POSIX platforms

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Submitted [https://github.com/arkq/bluez-alsa/commit/070ed35ac5cef8138ed4760582bb72e8d3e136e2]
---
 src/main.c            | 2 +-
 test/mock/mock.c      | 2 +-
 utils/aplay/aplay.c   | 1 +
 utils/cli/cli.c       | 1 +
 utils/rfcomm/rfcomm.c | 1 +
 5 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/main.c b/src/main.c
index 96a66aee..eeb80165 100644
--- a/src/main.c
+++ b/src/main.c
@@ -13,13 +13,13 @@
 #endif
 
 #include <getopt.h>
+#include <libgen.h>
 #include <sched.h>
 #include <signal.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 #include <strings.h>
 #include <syslog.h>
 #include <time.h>
diff --git a/test/mock/mock.c b/test/mock/mock.c
index 947211a3..0a2f6091 100644
--- a/test/mock/mock.c
+++ b/test/mock/mock.c
@@ -20,12 +20,12 @@
 #include <assert.h>
 #include <errno.h>
 #include <getopt.h>
+#include <libgen.h>
 #include <signal.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 #include <strings.h>
 #include <sys/stat.h>
 #include <unistd.h>
diff --git a/utils/aplay/aplay.c b/utils/aplay/aplay.c
index 3de77902..36843e95 100644
--- a/utils/aplay/aplay.c
+++ b/utils/aplay/aplay.c
@@ -15,6 +15,7 @@
 #include <assert.h>
 #include <errno.h>
 #include <getopt.h>
+#include <libgen.h>
 #include <math.h>
 #include <poll.h>
 #include <pthread.h>
diff --git a/utils/cli/cli.c b/utils/cli/cli.c
index aeeabe58..0338b9e2 100644
--- a/utils/cli/cli.c
+++ b/utils/cli/cli.c
@@ -13,6 +13,7 @@
 #endif
 
 #include <getopt.h>
+#include <libgen.h>
 #include <stdarg.h>
 #include <stdbool.h>
 #include <stdint.h>
diff --git a/utils/rfcomm/rfcomm.c b/utils/rfcomm/rfcomm.c
index d01f0810..3dacfd67 100644
--- a/utils/rfcomm/rfcomm.c
+++ b/utils/rfcomm/rfcomm.c
@@ -15,6 +15,7 @@
 #include <ctype.h>
 #include <errno.h>
 #include <getopt.h>
+#include <libgen.h>
 #include <poll.h>
 #include <stdbool.h>
 #include <stdint.h>
