- if (!holdmsg && (Verbose || msg[0] != '0'))
- {
- (void) fflush(stdout);
- if (OpMode == MD_SMTP)
- fprintf(OutChannel, "%s\r\n", msg);
- else
- fprintf(OutChannel, "%s\n", &msg[4]);
- if (msg[3] == ' ')
- (void) fflush(OutChannel);
- if (ferror(OutChannel))
- {
- /* can't call syserr, 'cause we are using MsgBuf */
- HoldErrs = TRUE;
+ if (holdmsg || (!Verbose && msg[0] == '0'))
+ return;
+
+ (void) fflush(stdout);
+ if (OpMode == MD_SMTP)
+ fprintf(OutChannel, "%s\r\n", msg);
+ else
+ fprintf(OutChannel, "%s\n", &msg[4]);
+ if (msg[3] == ' ')
+ (void) fflush(OutChannel);
+ if (!ferror(OutChannel))
+ return;
+
+ /* error on output -- if reporting lost channel, just ignore it */
+ if (feof(InChannel) || ferror(InChannel))
+ return;
+
+ /* can't call syserr, 'cause we are using MsgBuf */
+ HoldErrs = TRUE;