From 39e311b2e17a53f7ed02fcbe3820ca77b65486d5 Mon Sep 17 00:00:00 2001 From: gshapiro Date: Wed, 28 Aug 2002 17:57:52 +0000 Subject: Import sendmail 8.12.6 --- contrib/sendmail/libmilter/comm.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'contrib/sendmail/libmilter/comm.c') diff --git a/contrib/sendmail/libmilter/comm.c b/contrib/sendmail/libmilter/comm.c index 0bf7e5c..73d51b1 100644 --- a/contrib/sendmail/libmilter/comm.c +++ b/contrib/sendmail/libmilter/comm.c @@ -9,7 +9,7 @@ */ #include -SM_RCSID("@(#)$Id: comm.c,v 8.54 2002/03/06 16:03:26 ca Exp $") +SM_RCSID("@(#)$Id: comm.c,v 8.54.2.2 2002/08/16 17:09:13 ca Exp $") #include "libmilter.h" #include @@ -63,10 +63,19 @@ mi_rd_cmd(sd, timeout, cmd, rlen, name) return NULL; } - FD_Z; i = 0; - while ((ret = select(sd + 1, &readset, NULL, &excset, timeout)) >= 1) + for (;;) { + FD_Z; + ret = select(sd + 1, &readset, NULL, &excset, timeout); + if (ret == 0) + break; + else if (ret < 0) + { + if (errno == EINTR) + continue; + break; + } if (FD_ISSET(sd, &excset)) { *cmd = SMFIC_SELECT; @@ -90,7 +99,6 @@ mi_rd_cmd(sd, timeout, cmd, rlen, name) if (len >= (ssize_t) sizeof data - i) break; i += len; - FD_Z; } if (ret == 0) { @@ -129,9 +137,18 @@ mi_rd_cmd(sd, timeout, cmd, rlen, name) } i = 0; - FD_Z; - while ((ret = select(sd + 1, &readset, NULL, &excset, timeout)) == 1) + for (;;) { + FD_Z; + ret = select(sd + 1, &readset, NULL, &excset, timeout); + if (ret == 0) + break; + else if (ret < 0) + { + if (errno == EINTR) + continue; + break; + } if (FD_ISSET(sd, &excset)) { *cmd = SMFIC_SELECT; @@ -169,7 +186,6 @@ mi_rd_cmd(sd, timeout, cmd, rlen, name) return buf; } i += len; - FD_Z; } save_errno = errno; -- cgit v1.1