Signed-off-by: Bo Yang <boyang@samba.org>
/* tell client, we are closing ... */
nwritten = write(state->sock, &c, sizeof(c));
if (nwritten == -1) {
- DEBUG(2, ("final write to client failed: %s\n",
- strerror(errno)));
+ /*
+ * ignore EPIPE error here, because the other end might
+ * have already closed the socket.
+ */
+ if (errno != EPIPE) {
+ DEBUG(2, ("final write to client failed: %s\n",
+ strerror(errno)));
+ }
}
/* Close socket */