From fa512303c7795667dbb28a87bdd7c225a2de341e Mon Sep 17 00:00:00 2001
From: Ismael Luceno <ismael@iodev.co.uk>
Date: Wed, 24 Jul 2024 19:44:08 +0200
Subject: [PATCH 1/2] Fix usage of poll.h header

Change the legacy <sys/poll.h> to <poll.h> (POSIX.1-2001).

Upstream-Status: Pending
Origin: Source Mage
Signed-off-by: Ismael Luceno <ismael@sourcemage.org>
---
 src/ct/mainloop.c           | 2 +-
 src/ct/socket.c             | 2 +-
 src/ifd/ifd-kaan.c          | 2 +-
 src/ifd/ifd-smph.c          | 2 +-
 src/ifd/ifdhandler.c        | 2 +-
 src/ifd/ifdproxy.c          | 2 +-
 src/ifd/pcmcia-block.c      | 2 +-
 src/ifd/pcmcia.c            | 2 +-
 src/ifd/proto-gbp.c         | 2 +-
 src/ifd/proto-sync.c        | 2 +-
 src/ifd/proto-t0.c          | 2 +-
 src/ifd/proto-t1.c          | 2 +-
 src/ifd/ria-device.c        | 2 +-
 src/ifd/ria-server.c        | 2 +-
 src/ifd/serial.c            | 2 +-
 src/ifd/sys-bsd.c           | 2 +-
 src/ifd/sys-linux.c         | 2 +-
 src/ifd/sys-sunray.c        | 2 +-
 src/ifd/usb.c               | 2 +-
 src/include/openct/server.h | 2 +-
 20 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/ct/mainloop.c b/src/ct/mainloop.c
index 533fc74f120b..6cfffb19bd83 100644
--- a/src/ct/mainloop.c
+++ b/src/ct/mainloop.c
@@ -9,7 +9,7 @@
 #endif
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/ct/socket.c b/src/ct/socket.c
index ff0f410a3764..c9fdddac80f2 100644
--- a/src/ct/socket.c
+++ b/src/ct/socket.c
@@ -11,7 +11,7 @@
 #include <netinet/in.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/un.h>
 #include <unistd.h>
 #include <errno.h>
diff --git a/src/ifd/ifd-kaan.c b/src/ifd/ifd-kaan.c
index 08a2e3709603..92c2b941c303 100644
--- a/src/ifd/ifd-kaan.c
+++ b/src/ifd/ifd-kaan.c
@@ -6,7 +6,7 @@
  */
 
 #include "internal.h"
-#include <sys/poll.h>
+#include <poll.h>
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
diff --git a/src/ifd/ifd-smph.c b/src/ifd/ifd-smph.c
index 4d99cecbc59d..03eba8463a72 100644
--- a/src/ifd/ifd-smph.c
+++ b/src/ifd/ifd-smph.c
@@ -16,7 +16,7 @@
 #include <stdlib.h>
 #include <sys/ioctl.h>
 #include <termios.h>
-#include <sys/poll.h>
+#include <poll.h>
 
 #define PHS_CONV_DIRECT	0
 #define PHS_CONV_INDIRECT 1
diff --git a/src/ifd/ifdhandler.c b/src/ifd/ifdhandler.c
index 12686c95f880..d2f705953ef1 100644
--- a/src/ifd/ifdhandler.c
+++ b/src/ifd/ifdhandler.c
@@ -7,7 +7,7 @@
 #include "internal.h"
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/poll.h>
+#include <poll.h>
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #endif
diff --git a/src/ifd/ifdproxy.c b/src/ifd/ifdproxy.c
index b84f54f43e12..e1156d04588a 100644
--- a/src/ifd/ifdproxy.c
+++ b/src/ifd/ifdproxy.c
@@ -10,7 +10,7 @@
 #endif
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
 #ifdef HAVE_GETOPT_H
diff --git a/src/ifd/pcmcia-block.c b/src/ifd/pcmcia-block.c
index 3c8715d8170a..a6afccb8cad1 100644
--- a/src/ifd/pcmcia-block.c
+++ b/src/ifd/pcmcia-block.c
@@ -8,7 +8,7 @@
 #include "internal.h"
 #include <sys/types.h>
 #include <sys/select.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/ioctl.h>
 #include <unistd.h>
 #include <errno.h>
diff --git a/src/ifd/pcmcia.c b/src/ifd/pcmcia.c
index b271d947fcb6..0590bc8cb905 100644
--- a/src/ifd/pcmcia.c
+++ b/src/ifd/pcmcia.c
@@ -8,7 +8,7 @@
 #include "internal.h"
 #include <sys/types.h>
 #include <sys/select.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/ioctl.h>
 #include <unistd.h>
 #include <errno.h>
diff --git a/src/ifd/proto-gbp.c b/src/ifd/proto-gbp.c
index 8de0554cbe5f..9581090aa31a 100644
--- a/src/ifd/proto-gbp.c
+++ b/src/ifd/proto-gbp.c
@@ -11,7 +11,7 @@
  */
 
 #include "internal.h"
-#include <sys/poll.h>
+#include <poll.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/ifd/proto-sync.c b/src/ifd/proto-sync.c
index 37a74fb2ac69..c50920c32b7a 100644
--- a/src/ifd/proto-sync.c
+++ b/src/ifd/proto-sync.c
@@ -5,7 +5,7 @@
  */
 
 #include "internal.h"
-#include <sys/poll.h>
+#include <poll.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/ifd/proto-t0.c b/src/ifd/proto-t0.c
index f5017297c4a4..8a51834f17e4 100644
--- a/src/ifd/proto-t0.c
+++ b/src/ifd/proto-t0.c
@@ -5,7 +5,7 @@
  */
 
 #include "internal.h"
-#include <sys/poll.h>
+#include <poll.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/ifd/proto-t1.c b/src/ifd/proto-t1.c
index 886f03b8ec4f..4e406e140677 100644
--- a/src/ifd/proto-t1.c
+++ b/src/ifd/proto-t1.c
@@ -8,7 +8,7 @@
  */
 
 #include "internal.h"
-#include <sys/poll.h>
+#include <poll.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/ifd/ria-device.c b/src/ifd/ria-device.c
index 46b14229be36..b2ed7e874030 100644
--- a/src/ifd/ria-device.c
+++ b/src/ifd/ria-device.c
@@ -10,7 +10,7 @@
 #endif
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
 #include <stdio.h>
diff --git a/src/ifd/ria-server.c b/src/ifd/ria-server.c
index a5a5f131574c..de2235868a5e 100644
--- a/src/ifd/ria-server.c
+++ b/src/ifd/ria-server.c
@@ -10,7 +10,7 @@
 #endif
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
 #include <stdio.h>
diff --git a/src/ifd/serial.c b/src/ifd/serial.c
index 985b815087bc..b1743fddef12 100644
--- a/src/ifd/serial.c
+++ b/src/ifd/serial.c
@@ -7,7 +7,7 @@
 #include "internal.h"
 #include <sys/types.h>
 #include <sys/select.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/ioctl.h>
 #include <unistd.h>
 #include <fcntl.h>
diff --git a/src/ifd/sys-bsd.c b/src/ifd/sys-bsd.c
index 75355f8a6ef5..c8e6d2e66f19 100644
--- a/src/ifd/sys-bsd.c
+++ b/src/ifd/sys-bsd.c
@@ -22,7 +22,7 @@
 #endif /* !ENABLE_LIBUSB */
 #include <sys/stat.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/file.h>
 #include <string.h>
 #include <stdio.h>
diff --git a/src/ifd/sys-linux.c b/src/ifd/sys-linux.c
index c8bdea2fa36c..7277f8ec5e5f 100644
--- a/src/ifd/sys-linux.c
+++ b/src/ifd/sys-linux.c
@@ -13,7 +13,7 @@
 #include <sys/sysmacros.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/file.h>
diff --git a/src/ifd/sys-sunray.c b/src/ifd/sys-sunray.c
index 03b590c32fbe..890124fe3de6 100644
--- a/src/ifd/sys-sunray.c
+++ b/src/ifd/sys-sunray.c
@@ -13,7 +13,7 @@
 #include <usb.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
-#include <sys/poll.h>
+#include <poll.h>
 #include <string.h>
 #include <stdio.h>
 #include <signal.h>
diff --git a/src/ifd/usb.c b/src/ifd/usb.c
index 9977b51fbb40..360aebc40ea8 100644
--- a/src/ifd/usb.c
+++ b/src/ifd/usb.c
@@ -5,7 +5,7 @@
  */
 
 #include "internal.h"
-#include <sys/poll.h>
+#include <poll.h>
 #include <stdlib.h>
 #include <string.h>
 #include <fcntl.h>
diff --git a/src/include/openct/server.h b/src/include/openct/server.h
index be0a28dc75fb..2201a7d52739 100644
--- a/src/include/openct/server.h
+++ b/src/include/openct/server.h
@@ -11,7 +11,7 @@
 extern "C" {
 #endif
 
-#include <sys/poll.h>
+#include <poll.h>
 
 extern void	ct_mainloop_add_socket(ct_socket_t *);
 extern void	ct_mainloop(void);
-- 
2.44.0

