aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-12-31 05:46:52 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-12-31 05:46:52 +0000
commitc1ca94d8095ca6dace7585b9822bef0ace216e43 (patch)
tree6f1f9b93556bea962127097c44e4d40a11365209 /driver.c
parent3c799b35db0cc8cc0a31a3a74426a5bf1390662e (diff)
downloadfetchmail-c1ca94d8095ca6dace7585b9822bef0ace216e43.tar.gz
fetchmail-c1ca94d8095ca6dace7585b9822bef0ace216e43.tar.bz2
fetchmail-c1ca94d8095ca6dace7585b9822bef0ace216e43.zip
Maybe this fixes Ron Gomes's hang bug?
svn path=/trunk/; revision=2303
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/driver.c b/driver.c
index c3004ebe..4b649ced 100644
--- a/driver.c
+++ b/driver.c
@@ -1402,6 +1402,22 @@ const struct method *proto; /* protocol method table */
if ((js = setjmp(restart)) == 1)
{
+#ifdef HAVE_SIGPROCMASK
+ /*
+ * Don't rely on setjmp() to restore the blocked-signal mask.
+ * It does this under BSD but is required not to under POSIX.
+ *
+ * If your Unix doesn't have sigprocmask, better hope it has
+ * BSD-like behavior. Otherwise you may see fetchmail get
+ * permanently wedged after a second timeout on a bad read,
+ * because alarm signals were blocked after the first.
+ */
+ sigset_t allsigs;
+
+ sigfillset(&allsigs);
+ sigprocmask(SIG_UNBLOCK, &allsigs, NULL);
+#endif /* HAVE_SIGPROCMASK */
+
if (phase == OPEN_WAIT)
error(0, 0,
_("timeout after %d seconds waiting to connect to server %s."),