From df9d522301cbc3e73e9816485f7deb744ae6f373 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 13 Dec 2002 05:11:05 +0000 Subject: Ready to ship 6-2-0. svn path=/trunk/; revision=3776 --- smtp.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'smtp.c') 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")); -- cgit v1.2.3