Commit Diff


commit - fe24f0a37093d812e8f7eb29a626a6d3f0b92aea
commit + 813645df7b21d54ae779e80fc6e7ad9c913b67d6
blob - 020f1c5b26ce81182b90f2762c14aaf6e1144176
blob + 8c41efaa709011edca44b1445296029d36c0644f
--- lib/bufio.c
+++ lib/bufio.c
@@ -287,6 +287,8 @@ bufio_read(struct bufio *bio)
 			bio->wantev = BUFIO_WANT_WRITE;
 			return (-1);
 		case -1:
+			bio->wantev = 0;
+			errno = 0;
 			return (-1);
 		default:
 			bio->wantev = 0;