aboutsummaryrefslogtreecommitdiffstats
path: root/smtp.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2002-12-13 05:11:05 +0000
committerEric S. Raymond <esr@thyrsus.com>2002-12-13 05:11:05 +0000
commitdf9d522301cbc3e73e9816485f7deb744ae6f373 (patch)
tree92dce208df4c7f5203446d6eb5c1febe906f357b /smtp.c
parent8dcde6bdc0a17bd0bffb1f2436325038a0fa9103 (diff)
downloadfetchmail-df9d522301cbc3e73e9816485f7deb744ae6f373.tar.gz
fetchmail-df9d522301cbc3e73e9816485f7deb744ae6f373.tar.bz2
fetchmail-df9d522301cbc3e73e9816485f7deb744ae6f373.zip
Ready to ship 6-2-0.
svn path=/trunk/; revision=3776
Diffstat (limited to 'smtp.c')
-rw-r--r--smtp.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/smtp.c b/smtp.c
index 44b22989..7fdb8499 100644
--- a/smtp.c
+++ b/smtp.c
@@ -323,16 +323,13 @@ int SMTP_eom(int sock)
return ok;
}
-/* ignore SIGALRM signal indicating a timeout during smtp ok */
-static void smtp_timeout_handler (int signal) { }
-
int SMTP_ok(int sock)
/* returns status of SMTP connection */
{
- void (*alrmsave)(int);
+ SIGHANDLERTYPE alrmsave;
/* set an alarm for smtp ok */
- alrmsave = signal(SIGALRM, smtp_timeout_handler);
+ alrmsave = set_signal_handler(SIGALRM, null_signal_handler);
set_timeout(mytimeout);
while ((SockRead(sock, smtp_response, sizeof(smtp_response)-1)) != -1)
@@ -341,7 +338,7 @@ int SMTP_ok(int sock)
/* restore alarm */
set_timeout(0);
- signal(SIGALRM, alrmsave);
+ set_signal_handler(SIGALRM, alrmsave);
n = strlen(smtp_response);
if (n > 0 && smtp_response[n-1] == '\n')
@@ -366,14 +363,14 @@ int SMTP_ok(int sock)
return SM_ERROR;
/* set an alarm for smtp ok */
- signal(SIGALRM, smtp_timeout_handler);
+ set_signal_handler(SIGALRM, null_signal_handler);
set_timeout(mytimeout);
}
/* restore alarm */
set_timeout(0);
- signal(SIGALRM, alrmsave);
+ set_signal_handler(SIGALRM, alrmsave);
if (outlevel >= O_MONITOR)
report(stderr, GT_("smtp listener protocol error\n"));