s3: ignore EPIPE error when winbind finally writes to wb client because client might...
authorBo Yang <boyang@samba.org>
Thu, 21 May 2009 19:22:52 +0000 (03:22 +0800)
committerBo Yang <boyang@samba.org>
Thu, 21 May 2009 19:22:52 +0000 (03:22 +0800)
Signed-off-by: Bo Yang <boyang@samba.org>
source3/winbindd/winbindd.c

index fb7eda92c492d3bb545eda68099be913262312eb..52517b01bbe823a70b7f74a6869c4ec7b3580a9f 100644 (file)
@@ -866,8 +866,14 @@ static void remove_client(struct winbindd_cli_state *state)
        /* 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 */