2012-04-22 04:21:26 +02:00
|
|
|
--- rfc931.c.orig
|
2008-10-13 18:39:38 +02:00
|
|
|
+++ rfc931.c
|
2012-04-22 04:21:26 +02:00
|
|
|
@@ -92,6 +92,8 @@ char *dest;
|
2008-10-13 18:39:38 +02:00
|
|
|
char *cp;
|
|
|
|
char *result = unknown;
|
|
|
|
FILE *fp;
|
|
|
|
+ unsigned saved_timeout;
|
|
|
|
+ struct sigaction nact, oact;
|
|
|
|
|
|
|
|
#ifdef INET6
|
|
|
|
/* address family must be the same */
|
2012-04-22 04:21:26 +02:00
|
|
|
@@ -134,7 +136,12 @@ char *dest;
|
2008-10-13 18:39:38 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
if (sigsetjmp(timebuf, 1) == 0) {
|
|
|
|
- signal(SIGALRM, timeout);
|
|
|
|
+ /* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
|
|
|
|
+ saved_timeout = alarm(0);
|
|
|
|
+ nact.sa_handler = timeout;
|
|
|
|
+ nact.sa_flags = 0;
|
|
|
|
+ (void) sigemptyset(&nact.sa_mask);
|
|
|
|
+ (void) sigaction(SIGALRM, &nact, &oact);
|
|
|
|
alarm(rfc931_timeout);
|
|
|
|
|
|
|
|
/*
|
2012-04-22 04:21:26 +02:00
|
|
|
@@ -223,6 +230,10 @@ char *dest;
|
2008-10-13 18:39:38 +02:00
|
|
|
}
|
|
|
|
alarm(0);
|
|
|
|
}
|
|
|
|
+ /* Restore SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
|
|
|
|
+ (void) sigaction(SIGALRM, &oact, NULL);
|
|
|
|
+ if (saved_timeout > 0)
|
|
|
|
+ alarm(saved_timeout);
|
|
|
|
fclose(fp);
|
|
|
|
}
|
|
|
|
STRN_CPY(dest, result, STRING_LENGTH);
|