openssl: Revert local patch around fileno(stdin/stdout).
According to the commit history, this was introduced when gcc4.5 complained about using the return value of fileno without checking it against -1. gcc 10.4 no longer appears to object, so let's just nix the local patch.
This commit is contained in:
parent
964b90baf6
commit
e34dbb0364
|
@ -2770,16 +2770,6 @@ int s_client_main(int argc, char **argv)
|
|||
for (;;) {
|
||||
FD_ZERO(&readfds);
|
||||
FD_ZERO(&writefds);
|
||||
int fdin = fileno_stdin();
|
||||
if (fdin < 0) {
|
||||
BIO_printf(bio_err,"bad fileno for stdin\n");
|
||||
goto shut;
|
||||
}
|
||||
int fdout = fileno_stdout();
|
||||
if (fdout < 0) {
|
||||
BIO_printf(bio_err,"bad fileno for stdout\n");
|
||||
goto shut;
|
||||
}
|
||||
|
||||
if (SSL_is_dtls(con) && DTLSv1_get_timeout(con, &timeout))
|
||||
timeoutp = &timeout;
|
||||
|
@ -2834,10 +2824,10 @@ int s_client_main(int argc, char **argv)
|
|||
* set the flag so we exit.
|
||||
*/
|
||||
if (read_tty && !at_eof)
|
||||
openssl_fdset(fdin, &readfds);
|
||||
openssl_fdset(fileno_stdin(), &readfds);
|
||||
#if !defined(OPENSSL_SYS_VMS)
|
||||
if (write_tty)
|
||||
openssl_fdset(fdout, &writefds);
|
||||
openssl_fdset(fileno_stdout(), &writefds);
|
||||
#endif
|
||||
}
|
||||
if (read_ssl)
|
||||
|
@ -2965,7 +2955,7 @@ int s_client_main(int argc, char **argv)
|
|||
/* Assume Windows/DOS/BeOS can always write */
|
||||
else if (!ssl_pending && write_tty)
|
||||
#else
|
||||
else if (!ssl_pending && FD_ISSET(fdout, &writefds))
|
||||
else if (!ssl_pending && FD_ISSET(fileno_stdout(), &writefds))
|
||||
#endif
|
||||
{
|
||||
#ifdef CHARSET_EBCDIC
|
||||
|
@ -3052,7 +3042,7 @@ int s_client_main(int argc, char **argv)
|
|||
#if defined(OPENSSL_SYS_MSDOS)
|
||||
else if (has_stdin_waiting())
|
||||
#else
|
||||
else if (FD_ISSET(fdin, &readfds))
|
||||
else if (FD_ISSET(fileno_stdin(), &readfds))
|
||||
#endif
|
||||
{
|
||||
if (crlf) {
|
||||
|
|
|
@ -2265,7 +2265,7 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
|
|||
char *buf = NULL;
|
||||
fd_set readfds;
|
||||
int ret = 1, width;
|
||||
int k, i, fdin;
|
||||
int k, i;
|
||||
unsigned long l;
|
||||
SSL *con = NULL;
|
||||
BIO *sbio;
|
||||
|
@ -2449,14 +2449,9 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
|
|||
|| (async && SSL_waiting_for_async(con));
|
||||
|
||||
if (!read_from_sslcon) {
|
||||
fdin = fileno_stdin();
|
||||
if (fdin < 0) {
|
||||
BIO_printf(bio_err,"Bad fileno for stdin\n");
|
||||
goto err;
|
||||
}
|
||||
FD_ZERO(&readfds);
|
||||
#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS)
|
||||
openssl_fdset(fdin, &readfds);
|
||||
openssl_fdset(fileno_stdin(), &readfds);
|
||||
#endif
|
||||
openssl_fdset(s, &readfds);
|
||||
/*
|
||||
|
@ -2493,7 +2488,7 @@ static int sv_body(int s, int stype, int prot, unsigned char *context)
|
|||
|
||||
if (i <= 0)
|
||||
continue;
|
||||
if (FD_ISSET(fdin, &readfds))
|
||||
if (FD_ISSET(fileno_stdin(), &readfds))
|
||||
read_from_terminal = 1;
|
||||
#endif
|
||||
if (FD_ISSET(s, &readfds))
|
||||
|
|
Loading…
Reference in New Issue