diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2002-08-28 17:57:52 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2002-08-28 17:57:52 +0000 |
commit | 39e311b2e17a53f7ed02fcbe3820ca77b65486d5 (patch) | |
tree | 917921b3db147e850cc818686dc5ee3127c9842b /contrib/sendmail/libmilter/comm.c | |
parent | fc4e7b69e3f764d3a1d9157868bc6965ef1db7d6 (diff) | |
download | FreeBSD-src-39e311b2e17a53f7ed02fcbe3820ca77b65486d5.zip FreeBSD-src-39e311b2e17a53f7ed02fcbe3820ca77b65486d5.tar.gz |
Import sendmail 8.12.6
Diffstat (limited to 'contrib/sendmail/libmilter/comm.c')
-rw-r--r-- | contrib/sendmail/libmilter/comm.c | 30 |
1 files changed, 23 insertions, 7 deletions
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/gen.h> -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 <sm/errstring.h> @@ -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; |