Skip to content

Commit

Permalink
Added HAVE_SYS_TTYDEFAULTS_H to only include <sys/ttydefaults.h> on L…
Browse files Browse the repository at this point in the history
…inux for musl libc
  • Loading branch information
raforg committed Mar 1, 2021
1 parent 13fee0c commit 6b28c54
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 0 deletions.
4 changes: 4 additions & 0 deletions conf/freebsd
Expand Up @@ -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:
4 changes: 4 additions & 0 deletions conf/gnuhurd
Expand Up @@ -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:
4 changes: 4 additions & 0 deletions conf/kfreebsd
Expand Up @@ -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:
4 changes: 4 additions & 0 deletions conf/linux
Expand Up @@ -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:
4 changes: 4 additions & 0 deletions conf/macosx
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions conf/netbsd
Expand Up @@ -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:
4 changes: 4 additions & 0 deletions conf/openbsd
Expand Up @@ -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:
4 changes: 4 additions & 0 deletions conf/solaris10-cc
Expand Up @@ -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:
4 changes: 4 additions & 0 deletions conf/solaris10-gcc
Expand Up @@ -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:
4 changes: 4 additions & 0 deletions conf/solaris6-cc
Expand Up @@ -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:
4 changes: 4 additions & 0 deletions conf/solaris6-gcc
Expand Up @@ -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:
4 changes: 4 additions & 0 deletions conf/solaris8-cc
Expand Up @@ -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:
4 changes: 4 additions & 0 deletions conf/solaris8-gcc
Expand Up @@ -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:
3 changes: 3 additions & 0 deletions config.h
Expand Up @@ -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 <sys/ttydefaults.h> and need it for CEOF in musl libc (Linux only) */
#define HAVE_SYS_TTYDEFAULTS_H 1

#endif

/* vi:set ts=4 sw=4: */
2 changes: 2 additions & 0 deletions daemon.c
Expand Up @@ -940,7 +940,9 @@ I<elogind(8)>
#ifdef _RESTORE_POSIX_SOURCE
#define _POSIX_SOURCE
#endif
#ifdef HAVE_SYS_TTYDEFAULTS_H /* For CEOF in musl libc (Linux only) */
#include <sys/ttydefaults.h>
#endif
#include <dirent.h>
#include <sys/wait.h>
#include <sys/stat.h>
Expand Down

0 comments on commit 6b28c54

Please sign in to comment.