blob: 0c2c48746654b89ac1e85a34f7bcea9e72344b0c [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001From 12de53b0f24c478ea4ff6b4e2c55366dbd2f02b1 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
3Date: Fri, 25 Nov 2016 09:33:20 +0000
4Subject: [PATCH] use POSIX poll.h instead of sys/poll.h
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9POSIX specifies that <poll.h> is the correct header to
10include for poll()
11 http://pubs.opengroup.org/onlinepubs/009695399/functions/poll.html
12whereas <sys/poll.h> is only needed for ancient glibc (<2.3),
13so let's follow POSIX instead.
14
15As a side-effect, this silences compilation warnings when
16compiling against the musl C-library such as:
17
18| In file included from ../../libdbus-c++-0.9.0/src/eventloop.cpp:31:0:
19| <sysroot>/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
20| #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
21| ^~~~~~~
22| In file included from ../../libdbus-c++-0.9.0/src/eventloop-integration.cpp:39:0:
23| <sysroot>/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
24| #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
25| ^~~~~~~
26
27Signed-off-by: André Draszik <git@andred.net>
28---
29Upstream-Status: Submitted [https://github.com/andreas-volz/dbus-cplusplus/pull/3]
30Signed-off-by: André Draszik <adraszik@tycoint.com>
31 src/eventloop-integration.cpp | 2 +-
32 src/eventloop.cpp | 2 +-
33 src/pipe.cpp | 2 +-
34 3 files changed, 3 insertions(+), 3 deletions(-)
35
36diff --git a/src/eventloop-integration.cpp b/src/eventloop-integration.cpp
37index 5776971..271b503 100644
38--- a/src/eventloop-integration.cpp
39+++ b/src/eventloop-integration.cpp
40@@ -36,7 +36,7 @@
41 /* STD */
42 #include <string.h>
43 #include <cassert>
44-#include <sys/poll.h>
45+#include <poll.h>
46 #include <fcntl.h>
47 #include <unistd.h>
48
49diff --git a/src/eventloop.cpp b/src/eventloop.cpp
50index f622812..7790e1e 100644
51--- a/src/eventloop.cpp
52+++ b/src/eventloop.cpp
53@@ -28,7 +28,7 @@
54 #include <dbus-c++/eventloop.h>
55 #include <dbus-c++/debug.h>
56
57-#include <sys/poll.h>
58+#include <poll.h>
59 #include <sys/time.h>
60
61 #include <dbus/dbus.h>
62diff --git a/src/pipe.cpp b/src/pipe.cpp
63index 01211b3..45c2ba6 100644
64--- a/src/pipe.cpp
65+++ b/src/pipe.cpp
66@@ -32,7 +32,7 @@
67
68 /* STD */
69 #include <unistd.h>
70-#include <sys/poll.h>
71+#include <poll.h>
72 #include <fcntl.h>
73 #include <errno.h>
74 #include <cassert>
75--
762.10.2
77