From d4570f9598e8c7a5dffa25307a79b1ca7569c28e Mon Sep 17 00:00:00 2001 From: deraadt Date: Thu, 17 Apr 2014 10:24:08 +0000 Subject: [PATCH] unistd.h is always in the same place; no need to #include the result of a maze of conditional #define's --- lib/libcrypto/bf/bf_opts.c | 2 +- lib/libcrypto/bf/bfspeed.c | 2 +- lib/libcrypto/cast/cast_spd.c | 2 +- lib/libcrypto/cast/castopts.c | 2 +- lib/libcrypto/des/des_locl.h | 10 +--------- lib/libcrypto/des/des_opts.c | 2 +- lib/libcrypto/des/speed.c | 2 +- lib/libcrypto/idea/idea_spd.c | 2 +- lib/libcrypto/opensslconf.h.in | 3 --- lib/libcrypto/rc2/rc2speed.c | 2 +- lib/libcrypto/rc4/rc4speed.c | 2 +- lib/libcrypto/rc5/rc5speed.c | 2 +- lib/libssl/src/apps/s_time.c | 2 +- lib/libssl/src/apps/speed.c | 2 +- lib/libssl/src/crypto/bf/bf_opts.c | 2 +- lib/libssl/src/crypto/bf/bfspeed.c | 2 +- lib/libssl/src/crypto/cast/cast_spd.c | 2 +- lib/libssl/src/crypto/cast/castopts.c | 2 +- lib/libssl/src/crypto/des/des_locl.h | 10 +--------- lib/libssl/src/crypto/des/des_opts.c | 2 +- lib/libssl/src/crypto/des/speed.c | 2 +- lib/libssl/src/crypto/idea/idea_spd.c | 2 +- lib/libssl/src/crypto/opensslconf.h.in | 3 --- lib/libssl/src/crypto/rc2/rc2speed.c | 2 +- lib/libssl/src/crypto/rc4/rc4speed.c | 2 +- lib/libssl/src/crypto/rc5/rc5speed.c | 2 +- lib/libssl/src/ssl/ssltest.c | 11 +++++------ 27 files changed, 29 insertions(+), 52 deletions(-) diff --git a/lib/libcrypto/bf/bf_opts.c b/lib/libcrypto/bf/bf_opts.c index 1721bb99b4a..7a2a8b571c6 100644 --- a/lib/libcrypto/bf/bf_opts.c +++ b/lib/libcrypto/bf/bf_opts.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libcrypto/bf/bfspeed.c b/lib/libcrypto/bf/bfspeed.c index c41ef3b4035..4fbf81d00c7 100644 --- a/lib/libcrypto/bf/bfspeed.c +++ b/lib/libcrypto/bf/bfspeed.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libcrypto/cast/cast_spd.c b/lib/libcrypto/cast/cast_spd.c index d650af475c3..0f99e0e570d 100644 --- a/lib/libcrypto/cast/cast_spd.c +++ b/lib/libcrypto/cast/cast_spd.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libcrypto/cast/castopts.c b/lib/libcrypto/cast/castopts.c index 33b2c7b06fd..f18a49bd6ee 100644 --- a/lib/libcrypto/cast/castopts.c +++ b/lib/libcrypto/cast/castopts.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libcrypto/des/des_locl.h b/lib/libcrypto/des/des_locl.h index a3b512e9b04..cf7811041ef 100644 --- a/lib/libcrypto/des/des_locl.h +++ b/lib/libcrypto/des/des_locl.h @@ -70,16 +70,8 @@ #include #include -#ifndef OPENSSL_SYS_MSDOS -#if !defined(OPENSSL_SYS_VMS) || defined(__DECC) -#ifdef OPENSSL_UNISTD -# include OPENSSL_UNISTD -#else -# include -#endif +#include #include -#endif -#endif #include #ifdef OPENSSL_SYS_MSDOS /* Visual C++ 2.1 (Windows NT/95) */ diff --git a/lib/libcrypto/des/des_opts.c b/lib/libcrypto/des/des_opts.c index 2df82962c5a..c713c5e3195 100644 --- a/lib/libcrypto/des/des_opts.c +++ b/lib/libcrypto/des/des_opts.c @@ -66,7 +66,7 @@ #include #ifndef OPENSSL_SYS_MSDOS #include -#include OPENSSL_UNISTD +#include #else #include extern void exit(); diff --git a/lib/libcrypto/des/speed.c b/lib/libcrypto/des/speed.c index 1616f4b7c95..67a8edf00ff 100644 --- a/lib/libcrypto/des/speed.c +++ b/lib/libcrypto/des/speed.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libcrypto/idea/idea_spd.c b/lib/libcrypto/idea/idea_spd.c index 699353e8719..cce4be9e6fb 100644 --- a/lib/libcrypto/idea/idea_spd.c +++ b/lib/libcrypto/idea/idea_spd.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libcrypto/opensslconf.h.in b/lib/libcrypto/opensslconf.h.in index 97e37455634..4c92f144cb0 100644 --- a/lib/libcrypto/opensslconf.h.in +++ b/lib/libcrypto/opensslconf.h.in @@ -10,9 +10,6 @@ #endif #endif -#undef OPENSSL_UNISTD -#define OPENSSL_UNISTD - #undef OPENSSL_EXPORT_VAR_AS_FUNCTION #if defined(HEADER_IDEA_H) && !defined(IDEA_INT) diff --git a/lib/libcrypto/rc2/rc2speed.c b/lib/libcrypto/rc2/rc2speed.c index 85cf6f65bf1..31bfc453f5c 100644 --- a/lib/libcrypto/rc2/rc2speed.c +++ b/lib/libcrypto/rc2/rc2speed.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libcrypto/rc4/rc4speed.c b/lib/libcrypto/rc4/rc4speed.c index 0ebd38123d0..a1207231fa9 100644 --- a/lib/libcrypto/rc4/rc4speed.c +++ b/lib/libcrypto/rc4/rc4speed.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libcrypto/rc5/rc5speed.c b/lib/libcrypto/rc5/rc5speed.c index 8e363be535b..3bcc8f49c0a 100644 --- a/lib/libcrypto/rc5/rc5speed.c +++ b/lib/libcrypto/rc5/rc5speed.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libssl/src/apps/s_time.c b/lib/libssl/src/apps/s_time.c index 5f02e5fd036..1eb01f6d2f6 100644 --- a/lib/libssl/src/apps/s_time.c +++ b/lib/libssl/src/apps/s_time.c @@ -81,7 +81,7 @@ #include "winmain.h" #include "wintext.h" #endif -#include OPENSSL_UNISTD +#include #undef PROG #define PROG s_time_main diff --git a/lib/libssl/src/apps/speed.c b/lib/libssl/src/apps/speed.c index fb4f25ed418..72aa867ae49 100644 --- a/lib/libssl/src/apps/speed.c +++ b/lib/libssl/src/apps/speed.c @@ -100,7 +100,7 @@ #include #include #include -#include OPENSSL_UNISTD +#include #include diff --git a/lib/libssl/src/crypto/bf/bf_opts.c b/lib/libssl/src/crypto/bf/bf_opts.c index 1721bb99b4a..7a2a8b571c6 100644 --- a/lib/libssl/src/crypto/bf/bf_opts.c +++ b/lib/libssl/src/crypto/bf/bf_opts.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libssl/src/crypto/bf/bfspeed.c b/lib/libssl/src/crypto/bf/bfspeed.c index c41ef3b4035..4fbf81d00c7 100644 --- a/lib/libssl/src/crypto/bf/bfspeed.c +++ b/lib/libssl/src/crypto/bf/bfspeed.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libssl/src/crypto/cast/cast_spd.c b/lib/libssl/src/crypto/cast/cast_spd.c index d650af475c3..0f99e0e570d 100644 --- a/lib/libssl/src/crypto/cast/cast_spd.c +++ b/lib/libssl/src/crypto/cast/cast_spd.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libssl/src/crypto/cast/castopts.c b/lib/libssl/src/crypto/cast/castopts.c index 33b2c7b06fd..f18a49bd6ee 100644 --- a/lib/libssl/src/crypto/cast/castopts.c +++ b/lib/libssl/src/crypto/cast/castopts.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libssl/src/crypto/des/des_locl.h b/lib/libssl/src/crypto/des/des_locl.h index a3b512e9b04..cf7811041ef 100644 --- a/lib/libssl/src/crypto/des/des_locl.h +++ b/lib/libssl/src/crypto/des/des_locl.h @@ -70,16 +70,8 @@ #include #include -#ifndef OPENSSL_SYS_MSDOS -#if !defined(OPENSSL_SYS_VMS) || defined(__DECC) -#ifdef OPENSSL_UNISTD -# include OPENSSL_UNISTD -#else -# include -#endif +#include #include -#endif -#endif #include #ifdef OPENSSL_SYS_MSDOS /* Visual C++ 2.1 (Windows NT/95) */ diff --git a/lib/libssl/src/crypto/des/des_opts.c b/lib/libssl/src/crypto/des/des_opts.c index 2df82962c5a..c713c5e3195 100644 --- a/lib/libssl/src/crypto/des/des_opts.c +++ b/lib/libssl/src/crypto/des/des_opts.c @@ -66,7 +66,7 @@ #include #ifndef OPENSSL_SYS_MSDOS #include -#include OPENSSL_UNISTD +#include #else #include extern void exit(); diff --git a/lib/libssl/src/crypto/des/speed.c b/lib/libssl/src/crypto/des/speed.c index 1616f4b7c95..67a8edf00ff 100644 --- a/lib/libssl/src/crypto/des/speed.c +++ b/lib/libssl/src/crypto/des/speed.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libssl/src/crypto/idea/idea_spd.c b/lib/libssl/src/crypto/idea/idea_spd.c index 699353e8719..cce4be9e6fb 100644 --- a/lib/libssl/src/crypto/idea/idea_spd.c +++ b/lib/libssl/src/crypto/idea/idea_spd.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libssl/src/crypto/opensslconf.h.in b/lib/libssl/src/crypto/opensslconf.h.in index 97e37455634..4c92f144cb0 100644 --- a/lib/libssl/src/crypto/opensslconf.h.in +++ b/lib/libssl/src/crypto/opensslconf.h.in @@ -10,9 +10,6 @@ #endif #endif -#undef OPENSSL_UNISTD -#define OPENSSL_UNISTD - #undef OPENSSL_EXPORT_VAR_AS_FUNCTION #if defined(HEADER_IDEA_H) && !defined(IDEA_INT) diff --git a/lib/libssl/src/crypto/rc2/rc2speed.c b/lib/libssl/src/crypto/rc2/rc2speed.c index 85cf6f65bf1..31bfc453f5c 100644 --- a/lib/libssl/src/crypto/rc2/rc2speed.c +++ b/lib/libssl/src/crypto/rc2/rc2speed.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libssl/src/crypto/rc4/rc4speed.c b/lib/libssl/src/crypto/rc4/rc4speed.c index 0ebd38123d0..a1207231fa9 100644 --- a/lib/libssl/src/crypto/rc4/rc4speed.c +++ b/lib/libssl/src/crypto/rc4/rc4speed.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libssl/src/crypto/rc5/rc5speed.c b/lib/libssl/src/crypto/rc5/rc5speed.c index 8e363be535b..3bcc8f49c0a 100644 --- a/lib/libssl/src/crypto/rc5/rc5speed.c +++ b/lib/libssl/src/crypto/rc5/rc5speed.c @@ -66,7 +66,7 @@ #include #include -#include OPENSSL_UNISTD_IO +#include OPENSSL_DECLARE_EXIT #ifndef OPENSSL_SYS_NETWARE diff --git a/lib/libssl/src/ssl/ssltest.c b/lib/libssl/src/ssl/ssltest.c index 771c50a3e1e..e56c811a47a 100644 --- a/lib/libssl/src/ssl/ssltest.c +++ b/lib/libssl/src/ssl/ssltest.c @@ -187,13 +187,12 @@ #endif #include -#define _XOPEN_SOURCE_EXTENDED 1 /* Or gethostname won't be declared properly -on Compaq platforms (at least with DEC C). -Do not try to put it earlier, or IPv6 includes -get screwed... - */ +#define _XOPEN_SOURCE_EXTENDED 1 +/* Or gethostname won't be declared properly + on Compaq platforms (at least with DEC C). + Do not try to put it earlier, or IPv6 includes + get screwed... */ -#include OPENSSL_UNISTD # define TEST_SERVER_CERT "../apps/server.pem" # define TEST_CLIENT_CERT "../apps/client.pem" -- 2.20.1