From a105208cd95cd374e8863cc2593dce16e7ce8af3 Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Sat, 22 Jun 2013 19:29:47 +0200 Subject: [PATCH] OPENSSL-LISTEN in write-only context failed with Bad file descriptor --- CHANGES | 3 +++ xio-openssl.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 7e24458..a289b3e 100644 --- a/CHANGES +++ b/CHANGES @@ -233,6 +233,9 @@ corrections: Compilation failed under some non-Linux operating systems due to use of old rfd1 component + OPENSSL-LISTEN failed with "Bad file descriptor" when used in + write-only context + porting: Red Hat issue 1020203: configure checks fail with some compilers. Use case: clang diff --git a/xio-openssl.c b/xio-openssl.c index 1b9f3bb..a86870c 100644 --- a/xio-openssl.c +++ b/xio-openssl.c @@ -629,7 +629,7 @@ static int if (portname) { /* tcp listen; this can fork() for us; it only returns on error or on successful establishment of tcp connection */ - result = _xioopen_listen(xfd, xioflags, + result = _xioopen_listen(xfd, (xioflags&~XIO_ACCMODE)|XIO_RDWR, (struct sockaddr *)us, uslen, opts, pf, socktype, IPPROTO_TCP, #if WITH_RETRY