util.poll: Include unistd.h only for epoll
authorKim Alvefur <zash@zash.se>
Fri, 10 Feb 2023 00:37:05 +0100
changeset 12888 f5a75aaa8a25
parent 12887 0d5868a9e641
child 12890 686c3cdd4775
util.poll: Include unistd.h only for epoll This defines close(), which is only used with epoll, hence we don't need to include it when building in poll or select mode.
util-src/poll.c
--- a/util-src/poll.c	Thu Feb 09 22:58:01 2023 +0000
+++ b/util-src/poll.c	Fri Feb 10 00:37:05 2023 +0100
@@ -8,7 +8,6 @@
  *
  */
 
-#include <unistd.h>
 #include <string.h>
 #include <errno.h>
 
@@ -24,6 +23,7 @@
 #endif
 
 #ifdef USE_EPOLL
+#include <unistd.h>
 #include <sys/epoll.h>
 #ifndef MAX_EVENTS
 #define MAX_EVENTS 64