From c1ca94d8095ca6dace7585b9822bef0ace216e43 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 31 Dec 1998 05:46:52 +0000 Subject: Maybe this fixes Ron Gomes's hang bug? svn path=/trunk/; revision=2303 --- driver.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'driver.c') 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."), -- cgit v1.2.3