aboutsummaryrefslogtreecommitdiff
path: root/src/IO/IO.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/IO/IO.c')
-rw-r--r--src/IO/IO.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/IO/IO.c b/src/IO/IO.c
index 40677345..4b0285f2 100644
--- a/src/IO/IO.c
+++ b/src/IO/IO.c
@@ -133,7 +133,8 @@ static void IO_close_fd(IOData_t *io, int CloseCode)
/* With HTTP, if we close the writing part, the reading one also gets
* closed! (other clients may set 'IOFlag_ForceClose') */
- if ((io->Flags & IOFlag_ForceClose) || (CloseCode == IO_StopRdWr)) {
+ if (((io->Flags & IOFlag_ForceClose) || (CloseCode == IO_StopRdWr)) &&
+ io->FD != -1) {
do
st = close(io->FD);
while (st < 0 && errno == EINTR);