diff options
Diffstat (limited to 'contrib/sendmail/src/util.c')
-rw-r--r-- | contrib/sendmail/src/util.c | 76 |
1 files changed, 58 insertions, 18 deletions
diff --git a/contrib/sendmail/src/util.c b/contrib/sendmail/src/util.c index fa0f74a..e71627f 100644 --- a/contrib/sendmail/src/util.c +++ b/contrib/sendmail/src/util.c @@ -12,7 +12,7 @@ */ #ifndef lint -static char id[] = "@(#)$Id: util.c,v 8.225.2.1.2.8 2000/07/03 18:28:56 geir Exp $"; +static char id[] = "@(#)$Id: util.c,v 8.225.2.1.2.15 2000/10/18 23:46:07 ca Exp $"; #endif /* ! lint */ #include <sendmail.h> @@ -209,6 +209,7 @@ shorten_rfc822_string(string, length) ** If have to rebalance an already short enough string, ** need to do it within allocated space. */ + slen = strlen(string); if (length == 0 || slen < length) length = slen; @@ -500,10 +501,13 @@ log_sendmail_pid(e) } else { + long pid; extern char *CommandLineArgs; + pid = (long) getpid(); + /* write the process id on line 1 */ - fprintf(pidf, "%ld\n", (long) getpid()); + fprintf(pidf, "%ld\n", pid); /* line 2 contains all command line flags */ fprintf(pidf, "%s\n", CommandLineArgs); @@ -640,7 +644,7 @@ xputs(s) if (strchr("=~&?", *s) != NULL) (void) putchar(*s++); if (bitset(0200, *s)) - printf("{%s}", macname(*s++ & 0377)); + printf("{%s}", macname(bitidx(*s++))); else printf("%c", *s++); continue; @@ -918,6 +922,11 @@ putxline(l, len, mci, pxflags) { if (putc('.', mci->mci_out) == EOF) dead = TRUE; + else + { + /* record progress for DATA timeout */ + DataProgress = TRUE; + } if (TrafficLogFile != NULL) (void) putc('.', TrafficLogFile); } @@ -928,6 +937,11 @@ putxline(l, len, mci, pxflags) { if (putc('>', mci->mci_out) == EOF) dead = TRUE; + else + { + /* record progress for DATA timeout */ + DataProgress = TRUE; + } if (TrafficLogFile != NULL) (void) putc('>', TrafficLogFile); } @@ -942,9 +956,11 @@ putxline(l, len, mci, pxflags) dead = TRUE; break; } - - /* record progress for DATA timeout */ - DataProgress = TRUE; + else + { + /* record progress for DATA timeout */ + DataProgress = TRUE; + } } if (dead) break; @@ -957,10 +973,11 @@ putxline(l, len, mci, pxflags) dead = TRUE; break; } - - /* record progress for DATA timeout */ - DataProgress = TRUE; - + else + { + /* record progress for DATA timeout */ + DataProgress = TRUE; + } if (TrafficLogFile != NULL) { for (l = l_base; l < q; l++) @@ -981,6 +998,11 @@ putxline(l, len, mci, pxflags) { if (putc('.', mci->mci_out) == EOF) break; + else + { + /* record progress for DATA timeout */ + DataProgress = TRUE; + } if (TrafficLogFile != NULL) (void) putc('.', TrafficLogFile); } @@ -991,6 +1013,11 @@ putxline(l, len, mci, pxflags) { if (putc('>', mci->mci_out) == EOF) break; + else + { + /* record progress for DATA timeout */ + DataProgress = TRUE; + } if (TrafficLogFile != NULL) (void) putc('>', TrafficLogFile); } @@ -1003,9 +1030,11 @@ putxline(l, len, mci, pxflags) dead = TRUE; break; } - - /* record progress for DATA timeout */ - DataProgress = TRUE; + else + { + /* record progress for DATA timeout */ + DataProgress = TRUE; + } } if (dead) break; @@ -1014,6 +1043,11 @@ putxline(l, len, mci, pxflags) (void) putc('\n', TrafficLogFile); if (fputs(mci->mci_mailer->m_eol, mci->mci_out) == EOF) break; + else + { + /* record progress for DATA timeout */ + DataProgress = TRUE; + } if (l < end && *l == '\n') { if (*++l != ' ' && *l != '\t' && *l != '\0' && @@ -1021,13 +1055,15 @@ putxline(l, len, mci, pxflags) { if (putc(' ', mci->mci_out) == EOF) break; + else + { + /* record progress for DATA timeout */ + DataProgress = TRUE; + } if (TrafficLogFile != NULL) (void) putc(' ', TrafficLogFile); } } - - /* record progress for DATA timeout */ - DataProgress = TRUE; } while (l < end); } /* @@ -1347,8 +1383,10 @@ bitintersect(a, b) int i; for (i = BITMAPBYTES / sizeof (int); --i >= 0; ) + { if ((a[i] & b[i]) != 0) return TRUE; + } return FALSE; } /* @@ -1372,8 +1410,10 @@ bitzerop(map) int i; for (i = BITMAPBYTES / sizeof (int); --i >= 0; ) + { if (map[i] != 0) return FALSE; + } return TRUE; } /* @@ -1485,8 +1525,8 @@ checkfds(where) static BITMAP256 baseline; extern int DtableSize; - if (DtableSize > 256) - maxfd = 256; + if (DtableSize > BITMAPBITS) + maxfd = BITMAPBITS; else maxfd = DtableSize; if (where == NULL) |