diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-06-13 22:27:37 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-06-13 22:27:37 +0000 |
commit | af813b3984daef6339944a5f1b5be8477af0c995 (patch) | |
tree | 1ea4a9acd927d12eb2b93111d43723b8fbaf90c5 | |
parent | b683ab33c98b903467407487a3c0f74c400f32ea (diff) | |
download | fetchmail-af813b3984daef6339944a5f1b5be8477af0c995.tar.gz fetchmail-af813b3984daef6339944a5f1b5be8477af0c995.tar.bz2 fetchmail-af813b3984daef6339944a5f1b5be8477af0c995.zip |
Reclaim file descriptors on timeout.
svn path=/trunk/; revision=1096
-rw-r--r-- | driver.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1161,7 +1161,7 @@ int do_protocol(ctl, proto) struct query *ctl; /* parsed options with merged-in defaults */ const struct method *proto; /* protocol method table */ { - int ok, js, pst; + int ok, js, pst, sock = -1; char *msg, *cp, realname[HOSTLEN]; void (*sigsave)(); @@ -1213,13 +1213,17 @@ const struct method *proto; /* protocol method table */ error(0, 0, "timeout after %d seconds waiting for %s.", ctl->server.timeout, ctl->server.names->id); + if (ctl->smtp_socket != -1) + close(ctl->smtp_socket); + if (sock != -1) + close(sock); ok = PS_ERROR; } else { char buf [POPBUFSIZE+1], *sp; int *msgsizes, len, num, count, new, deletions = 0; - int sock, port, fetches; + int port, fetches; struct idlist *idp; /* execute pre-initialization command, if any */ |