if (ferror(f) && errno != EINTR && errno != EAGAIN) {
/* fatal error from fwrite() */
- if (!feof(f)) {
+ if (errno == EPIPE) {
+ ast_debug(1, "fwrite() failed due to reading end being closed: EPIPE\n");
+ } else if (!feof(f)) {
/* Don't spam the logs if it was just that the connection is closed. */
ast_log(LOG_ERROR, "fwrite() returned error: %s\n", strerror(errno));
}
continue;
}
if (errno && !feof(f)) {
- /* Don't spam the logs if it was just that the connection is closed. */
- ast_log(LOG_ERROR, "fflush() returned error: %s\n", strerror(errno));
+ if (errno == EPIPE) {
+ ast_debug(1, "fflush() failed due to reading end being closed: EPIPE\n");
+ } else {
+ /* Don't spam the logs if it was just that the connection is closed. */
+ ast_log(LOG_ERROR, "fflush() returned error: %s\n", strerror(errno));
+ }
}
n = -1;
break;