aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-06-13 22:27:37 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-06-13 22:27:37 +0000
commitaf813b3984daef6339944a5f1b5be8477af0c995 (patch)
tree1ea4a9acd927d12eb2b93111d43723b8fbaf90c5
parentb683ab33c98b903467407487a3c0f74c400f32ea (diff)
downloadfetchmail-af813b3984daef6339944a5f1b5be8477af0c995.tar.gz
fetchmail-af813b3984daef6339944a5f1b5be8477af0c995.tar.bz2
fetchmail-af813b3984daef6339944a5f1b5be8477af0c995.zip
Reclaim file descriptors on timeout.
svn path=/trunk/; revision=1096
-rw-r--r--driver.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/driver.c b/driver.c
index 9ca2e65d..c6d96fe6 100644
--- a/driver.c
+++ b/driver.c
@@ -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 */