From 6b28c54dd95b3e759e433e5a6276f416d9fa15ec Mon Sep 17 00:00:00 2001 From: raf Date: Mon, 1 Mar 2021 23:24:13 +1100 Subject: [PATCH] Added HAVE_SYS_TTYDEFAULTS_H to only include on Linux for musl libc --- conf/freebsd | 4 ++++ conf/gnuhurd | 4 ++++ conf/kfreebsd | 4 ++++ conf/linux | 4 ++++ conf/macosx | 4 ++++ conf/netbsd | 4 ++++ conf/openbsd | 4 ++++ conf/solaris10-cc | 4 ++++ conf/solaris10-gcc | 4 ++++ conf/solaris6-cc | 4 ++++ conf/solaris6-gcc | 4 ++++ conf/solaris8-cc | 4 ++++ conf/solaris8-gcc | 4 ++++ config.h | 3 +++ daemon.c | 2 ++ 15 files changed, 57 insertions(+) diff --git a/conf/freebsd b/conf/freebsd index a71ef04..ce3f37b 100755 --- a/conf/freebsd +++ b/conf/freebsd @@ -143,4 +143,8 @@ perl -pi \ -e 's/^#define (HAVE_POLL_THAT_ABORTS_WHEN_POLLFDS_IS_NULL) 1$/\/* #undef $1 *\//;' \ `find . -name config.h` +perl -pi \ + -e 's/^#define (HAVE_SYS_TTYDEFAULTS_H) 1$/\/\* #undef $1 \*\//;' \ + config.h + # vi:set ts=4 sw=4: diff --git a/conf/gnuhurd b/conf/gnuhurd index 20f645a..d59decb 100755 --- a/conf/gnuhurd +++ b/conf/gnuhurd @@ -143,4 +143,8 @@ perl -pi \ -e 's/^#define (HAVE_POLL_THAT_ABORTS_WHEN_POLLFDS_IS_NULL) 1$/\/* #undef $1 *\//;' \ `find . -name config.h` +perl -pi \ + -e 's/^#define (HAVE_SYS_TTYDEFAULTS_H) 1$/\/\* #undef $1 \*\//;' \ + config.h + # vi:set ts=4 sw=4: diff --git a/conf/kfreebsd b/conf/kfreebsd index 42bf7db..c4d00d8 100755 --- a/conf/kfreebsd +++ b/conf/kfreebsd @@ -143,4 +143,8 @@ perl -pi \ -e 's/^#define (HAVE_POLL_THAT_ABORTS_WHEN_POLLFDS_IS_NULL) 1$/\/* #undef $1 *\//;' \ `find . -name config.h` +perl -pi \ + -e 's/^#define (HAVE_SYS_TTYDEFAULTS_H) 1$/\/\* #undef $1 \*\//;' \ + config.h + # vi:set ts=4 sw=4: diff --git a/conf/linux b/conf/linux index f259797..f0c4d4f 100755 --- a/conf/linux +++ b/conf/linux @@ -143,6 +143,10 @@ perl -pi \ -e 's/^#define (HAVE_POLL_THAT_ABORTS_WHEN_POLLFDS_IS_NULL) 1$/\/* #undef $1 *\//;' \ `find . -name config.h` +perl -pi \ + -e 's/^\/\* #undef (HAVE_SYS_TTYDEFAULTS_H) \*\/$/#define $1 1/;' \ + config.h + conf/test-logind # vi:set ts=4 sw=4: diff --git a/conf/macosx b/conf/macosx index 546ff3d..db54a1b 100755 --- a/conf/macosx +++ b/conf/macosx @@ -143,6 +143,10 @@ perl -pi \ -e 's/^\/\* #undef (HAVE_POLL_THAT_ABORTS_WHEN_POLLFDS_IS_NULL) \*\/$/#define $1 1/;' \ `find . -name config.h` +perl -pi \ + -e 's/^#define (HAVE_SYS_TTYDEFAULTS_H) 1$/\/\* #undef $1 \*\//;' \ + config.h + # Old versions of macOS (e.g. 10.6.8) don't handle some newer clang -Wno-* options. # But don't test if macports (which uses a newer compiler than Xcode's). # We know it's macports because CC is set. diff --git a/conf/netbsd b/conf/netbsd index 72136f8..463d525 100755 --- a/conf/netbsd +++ b/conf/netbsd @@ -143,4 +143,8 @@ perl -pi \ -e 's/^#define (HAVE_POLL_THAT_ABORTS_WHEN_POLLFDS_IS_NULL) 1$/\/* #undef $1 *\//;' \ `find . -name config.h` +perl -pi \ + -e 's/^#define (HAVE_SYS_TTYDEFAULTS_H) 1$/\/\* #undef $1 \*\//;' \ + config.h + # vi:set ts=4 sw=4: diff --git a/conf/openbsd b/conf/openbsd index bce2559..d205225 100755 --- a/conf/openbsd +++ b/conf/openbsd @@ -143,4 +143,8 @@ perl -pi \ -e 's/^#define (HAVE_POLL_THAT_ABORTS_WHEN_POLLFDS_IS_NULL) 1$/\/* #undef $1 *\//;' \ `find . -name config.h` +perl -pi \ + -e 's/^#define (HAVE_SYS_TTYDEFAULTS_H) 1$/\/\* #undef $1 \*\//;' \ + config.h + # vi:set ts=4 sw=4: diff --git a/conf/solaris10-cc b/conf/solaris10-cc index 589dcca..29ae9bf 100755 --- a/conf/solaris10-cc +++ b/conf/solaris10-cc @@ -154,4 +154,8 @@ perl -pi \ -e 's/^#define (HAVE_POLL_THAT_ABORTS_WHEN_POLLFDS_IS_NULL) 1$/\/* #undef $1 *\//;' \ `find . -name config.h` +perl -pi \ + -e 's/^#define (HAVE_SYS_TTYDEFAULTS_H) 1$/\/\* #undef $1 \*\//;' \ + config.h + # vi:set ts=4 sw=4: diff --git a/conf/solaris10-gcc b/conf/solaris10-gcc index 9ae458e..a54e3c5 100755 --- a/conf/solaris10-gcc +++ b/conf/solaris10-gcc @@ -170,4 +170,8 @@ perl -pi \ -e 's/^\/\* #undef (HAVE_POLL_THAT_ABORTS_WHEN_POLLFDS_IS_NULL) \*\/$/#define $1 1/;' \ `find . -name config.h` +perl -pi \ + -e 's/^#define (HAVE_SYS_TTYDEFAULTS_H) 1$/\/\* #undef $1 \*\//;' \ + config.h + # vi:set ts=4 sw=4: diff --git a/conf/solaris6-cc b/conf/solaris6-cc index ab7967c..2139ca7 100755 --- a/conf/solaris6-cc +++ b/conf/solaris6-cc @@ -143,4 +143,8 @@ perl -pi \ -e 's/^#define (HAVE_POLL_THAT_ABORTS_WHEN_POLLFDS_IS_NULL) 1$/\/* #undef $1 *\//;' \ `find . -name config.h` +perl -pi \ + -e 's/^#define (HAVE_SYS_TTYDEFAULTS_H) 1$/\/\* #undef $1 \*\//;' \ + config.h + # vi:set ts=4 sw=4: diff --git a/conf/solaris6-gcc b/conf/solaris6-gcc index d2e6b38..5daa106 100755 --- a/conf/solaris6-gcc +++ b/conf/solaris6-gcc @@ -143,4 +143,8 @@ perl -pi \ -e 's/^#define (HAVE_POLL_THAT_ABORTS_WHEN_POLLFDS_IS_NULL) 1$/\/* #undef $1 *\//;' \ `find . -name config.h` +perl -pi \ + -e 's/^#define (HAVE_SYS_TTYDEFAULTS_H) 1$/\/\* #undef $1 \*\//;' \ + config.h + # vi:set ts=4 sw=4: diff --git a/conf/solaris8-cc b/conf/solaris8-cc index 8fa4f6f..a56fa1a 100755 --- a/conf/solaris8-cc +++ b/conf/solaris8-cc @@ -143,4 +143,8 @@ perl -pi \ -e 's/^#define (HAVE_POLL_THAT_ABORTS_WHEN_POLLFDS_IS_NULL) 1$/\/* #undef $1 *\//;' \ `find . -name config.h` +perl -pi \ + -e 's/^#define (HAVE_SYS_TTYDEFAULTS_H) 1$/\/\* #undef $1 \*\//;' \ + config.h + # vi:set ts=4 sw=4: diff --git a/conf/solaris8-gcc b/conf/solaris8-gcc index da55693..c28b6ed 100755 --- a/conf/solaris8-gcc +++ b/conf/solaris8-gcc @@ -143,4 +143,8 @@ perl -pi \ -e 's/^\/\* #undef (HAVE_POLL_THAT_ABORTS_WHEN_POLLFDS_IS_NULL) \*\/$/#define $1 1/;' \ `find . -name config.h` +perl -pi \ + -e 's/^#define (HAVE_SYS_TTYDEFAULTS_H) 1$/\/\* #undef $1 \*\//;' \ + config.h + # vi:set ts=4 sw=4: diff --git a/config.h b/config.h index 4feec25..7873b41 100644 --- a/config.h +++ b/config.h @@ -25,6 +25,9 @@ /* Define if we have systemd's logind or elogind (i.e. libsystemd or libelogind) */ /* #undef HAVE_LOGIND */ +/* Define if we have and need it for CEOF in musl libc (Linux only) */ +#define HAVE_SYS_TTYDEFAULTS_H 1 + #endif /* vi:set ts=4 sw=4: */ diff --git a/daemon.c b/daemon.c index efec61a..6d9e8c9 100644 --- a/daemon.c +++ b/daemon.c @@ -940,7 +940,9 @@ I #ifdef _RESTORE_POSIX_SOURCE #define _POSIX_SOURCE #endif +#ifdef HAVE_SYS_TTYDEFAULTS_H /* For CEOF in musl libc (Linux only) */ #include +#endif #include #include #include