async_sock: return -1/EPIPE if we're getting an end of file on read.
authorStefan Metzmacher <metze@samba.org>
Mon, 21 Sep 2009 00:36:06 +0000 (02:36 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 21 Sep 2009 04:04:53 +0000 (06:04 +0200)
This makes the error handling in the callers easier.

metze

lib/async_req/async_sock.c

index f5a0dfde708bd8b14065dcdbc09ad9e642a1fd3a..18adb42a0cb6aeeedbaf26429155db50ed3d1cd8 100644 (file)
@@ -160,6 +160,10 @@ static void async_recv_handler(struct tevent_context *ev,
                /* retry */
                return;
        }
+       if (state->received == 0) {
+               tevent_req_error(req, EPIPE);
+               return;
+       }
        if (state->received == -1) {
                tevent_req_error(req, errno);
                return;