summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>2018-11-14 01:10:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-14 07:32:24 (GMT)
commit2648ccc231b38206e2dafe9a6cc1ca0978bcef5e (patch)
tree41b4cd2c75ffdec1fd77bf9cf314a8078151ce5d /git-compat-util.h
parentd166e6afe5f257217836ef24a73764eba390c58d (diff)
downloadgit-2648ccc231b38206e2dafe9a6cc1ca0978bcef5e.zip
git-2648ccc231b38206e2dafe9a6cc1ca0978bcef5e.tar.gz
git-2648ccc231b38206e2dafe9a6cc1ca0978bcef5e.tar.bz2
git-compat-util: prefer poll.h to sys/poll.h
POSIX specifies that <poll.h> is the correct header for poll(2) whereas <sys/poll.h> is only needed for some old libc. Let's follow the POSIX way by default. This effectively eliminates musl's warning: warning redirecting incorrect #include <sys/poll.h> to <poll.h> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 3a08d99..f160581 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -180,9 +180,12 @@
#include <regex.h>
#include <utime.h>
#include <syslog.h>
-#ifndef NO_SYS_POLL_H
+#if !defined(NO_POLL_H)
+#include <poll.h>
+#elif !defined(NO_SYS_POLL_H)
#include <sys/poll.h>
#else
+/* Pull the compat stuff */
#include <poll.h>
#endif
#ifdef HAVE_BSD_SYSCTL