From 863611984864cccb9b7d50872d693238458b77ad Mon Sep 17 00:00:00 2001 From: beck Date: Fri, 18 Apr 2014 21:11:00 +0000 Subject: [PATCH] Unsurprisingly, since was so darn hard to find for OpenSSL developers they had resorted to manually protyping read(2) instead of incredible amount of preprocessor wizardry needed to find the ever illusive . Let's just include and we don't need to do this.. While we're at it flense out _OSD_POSIX and __DGJPP__ cruft. ok krw@ --- lib/libcrypto/err/err.c | 19 ------------------- lib/libcrypto/md4/md4.c | 4 +--- lib/libcrypto/md5/md5.c | 4 +--- lib/libcrypto/ripemd/rmd160.c | 4 +--- lib/libcrypto/sha/sha1.c | 4 +--- lib/libssl/src/crypto/err/err.c | 19 ------------------- lib/libssl/src/crypto/md4/md4.c | 4 +--- lib/libssl/src/crypto/md5/md5.c | 4 +--- lib/libssl/src/crypto/ripemd/rmd160.c | 4 +--- lib/libssl/src/crypto/sha/sha1.c | 4 +--- 10 files changed, 8 insertions(+), 62 deletions(-) diff --git a/lib/libcrypto/err/err.c b/lib/libcrypto/err/err.c index afc3130d08a..27a19bc52c9 100644 --- a/lib/libcrypto/err/err.c +++ b/lib/libcrypto/err/err.c @@ -697,25 +697,6 @@ void ERR_put_error(int lib, int func, int reason, const char *file, { ERR_STATE *es; -#ifdef _OSD_POSIX - /* In the BS2000-OSD POSIX subsystem, the compiler generates - * path names in the form "*POSIX(/etc/passwd)". - * This dirty hack strips them to something sensible. - * @@@ We shouldn't modify a const string, though. - */ - if (strncmp(file,"*POSIX(", sizeof("*POSIX(")-1) == 0) { - char *end; - - /* Skip the "*POSIX(" prefix */ - file += sizeof("*POSIX(")-1; - end = &file[strlen(file)-1]; - if (*end == ')') - *end = '\0'; - /* Optional: use the basename of the path only. */ - if ((end = strrchr(file, '/')) != NULL) - file = &end[1]; - } -#endif es=ERR_get_state(); es->top=(es->top+1)%ERR_NUM_ERRORS; diff --git a/lib/libcrypto/md4/md4.c b/lib/libcrypto/md4/md4.c index 141415ad4df..1b78f667f18 100644 --- a/lib/libcrypto/md4/md4.c +++ b/lib/libcrypto/md4/md4.c @@ -56,6 +56,7 @@ * [including the GNU Public Licence.] */ +#include #include #include #include @@ -64,9 +65,6 @@ void do_fp(FILE *f); void pt(unsigned char *md); -#if !defined(_OSD_POSIX) && !defined(__DJGPP__) -int read(int, void *, unsigned int); -#endif int main(int argc, char **argv) { diff --git a/lib/libcrypto/md5/md5.c b/lib/libcrypto/md5/md5.c index 563733abc50..3f6ec0791e2 100644 --- a/lib/libcrypto/md5/md5.c +++ b/lib/libcrypto/md5/md5.c @@ -56,6 +56,7 @@ * [including the GNU Public Licence.] */ +#include #include #include #include @@ -64,9 +65,6 @@ void do_fp(FILE *f); void pt(unsigned char *md); -#if !defined(_OSD_POSIX) && !defined(__DJGPP__) -int read(int, void *, unsigned int); -#endif int main(int argc, char **argv) { diff --git a/lib/libcrypto/ripemd/rmd160.c b/lib/libcrypto/ripemd/rmd160.c index b0ec5744989..d0bc59d03cc 100644 --- a/lib/libcrypto/ripemd/rmd160.c +++ b/lib/libcrypto/ripemd/rmd160.c @@ -56,6 +56,7 @@ * [including the GNU Public Licence.] */ +#include #include #include #include @@ -64,9 +65,6 @@ void do_fp(FILE *f); void pt(unsigned char *md); -#if !defined(_OSD_POSIX) && !defined(__DJGPP__) -int read(int, void *, unsigned int); -#endif int main(int argc, char **argv) { diff --git a/lib/libcrypto/sha/sha1.c b/lib/libcrypto/sha/sha1.c index d350c88ee47..fd56a1e7568 100644 --- a/lib/libcrypto/sha/sha1.c +++ b/lib/libcrypto/sha/sha1.c @@ -56,6 +56,7 @@ * [including the GNU Public Licence.] */ +#include #include #include #include @@ -64,9 +65,6 @@ void do_fp(FILE *f); void pt(unsigned char *md); -#ifndef _OSD_POSIX -int read(int, void *, unsigned int); -#endif int main(int argc, char **argv) { diff --git a/lib/libssl/src/crypto/err/err.c b/lib/libssl/src/crypto/err/err.c index afc3130d08a..27a19bc52c9 100644 --- a/lib/libssl/src/crypto/err/err.c +++ b/lib/libssl/src/crypto/err/err.c @@ -697,25 +697,6 @@ void ERR_put_error(int lib, int func, int reason, const char *file, { ERR_STATE *es; -#ifdef _OSD_POSIX - /* In the BS2000-OSD POSIX subsystem, the compiler generates - * path names in the form "*POSIX(/etc/passwd)". - * This dirty hack strips them to something sensible. - * @@@ We shouldn't modify a const string, though. - */ - if (strncmp(file,"*POSIX(", sizeof("*POSIX(")-1) == 0) { - char *end; - - /* Skip the "*POSIX(" prefix */ - file += sizeof("*POSIX(")-1; - end = &file[strlen(file)-1]; - if (*end == ')') - *end = '\0'; - /* Optional: use the basename of the path only. */ - if ((end = strrchr(file, '/')) != NULL) - file = &end[1]; - } -#endif es=ERR_get_state(); es->top=(es->top+1)%ERR_NUM_ERRORS; diff --git a/lib/libssl/src/crypto/md4/md4.c b/lib/libssl/src/crypto/md4/md4.c index 141415ad4df..1b78f667f18 100644 --- a/lib/libssl/src/crypto/md4/md4.c +++ b/lib/libssl/src/crypto/md4/md4.c @@ -56,6 +56,7 @@ * [including the GNU Public Licence.] */ +#include #include #include #include @@ -64,9 +65,6 @@ void do_fp(FILE *f); void pt(unsigned char *md); -#if !defined(_OSD_POSIX) && !defined(__DJGPP__) -int read(int, void *, unsigned int); -#endif int main(int argc, char **argv) { diff --git a/lib/libssl/src/crypto/md5/md5.c b/lib/libssl/src/crypto/md5/md5.c index 563733abc50..3f6ec0791e2 100644 --- a/lib/libssl/src/crypto/md5/md5.c +++ b/lib/libssl/src/crypto/md5/md5.c @@ -56,6 +56,7 @@ * [including the GNU Public Licence.] */ +#include #include #include #include @@ -64,9 +65,6 @@ void do_fp(FILE *f); void pt(unsigned char *md); -#if !defined(_OSD_POSIX) && !defined(__DJGPP__) -int read(int, void *, unsigned int); -#endif int main(int argc, char **argv) { diff --git a/lib/libssl/src/crypto/ripemd/rmd160.c b/lib/libssl/src/crypto/ripemd/rmd160.c index b0ec5744989..d0bc59d03cc 100644 --- a/lib/libssl/src/crypto/ripemd/rmd160.c +++ b/lib/libssl/src/crypto/ripemd/rmd160.c @@ -56,6 +56,7 @@ * [including the GNU Public Licence.] */ +#include #include #include #include @@ -64,9 +65,6 @@ void do_fp(FILE *f); void pt(unsigned char *md); -#if !defined(_OSD_POSIX) && !defined(__DJGPP__) -int read(int, void *, unsigned int); -#endif int main(int argc, char **argv) { diff --git a/lib/libssl/src/crypto/sha/sha1.c b/lib/libssl/src/crypto/sha/sha1.c index d350c88ee47..fd56a1e7568 100644 --- a/lib/libssl/src/crypto/sha/sha1.c +++ b/lib/libssl/src/crypto/sha/sha1.c @@ -56,6 +56,7 @@ * [including the GNU Public Licence.] */ +#include #include #include #include @@ -64,9 +65,6 @@ void do_fp(FILE *f); void pt(unsigned char *md); -#ifndef _OSD_POSIX -int read(int, void *, unsigned int); -#endif int main(int argc, char **argv) { -- 2.20.1