diff options
author | Đoàn Trần Công Danh <congdanhqx@gmail.com> | 2018-11-14 04:10:43 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-14 10:32:24 +0300 |
commit | 2648ccc231b38206e2dafe9a6cc1ca0978bcef5e (patch) | |
tree | 41b4cd2c75ffdec1fd77bf9cf314a8078151ce5d /git-compat-util.h | |
parent | d166e6afe5f257217836ef24a73764eba390c58d (diff) |
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.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index 3a08d9916f..f16058182f 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 |