unix/dgram: don't clear so_error in case of MSG_PEEK

This commit is contained in:
Gleb Smirnoff
2024-02-01 13:37:26 -08:00
parent d6d4183cc5
commit 5bdf8150cd
+2 -1
View File
@@ -1440,7 +1440,8 @@ uipc_soreceive_dgram(struct socket *so, struct sockaddr **psa, struct uio *uio,
(m = STAILQ_FIRST(&so->so_rcv.uxdg_mb)) == NULL) {
if (so->so_error) {
error = so->so_error;
so->so_error = 0;
if (!(flags & MSG_PEEK))
so->so_error = 0;
SOCK_RECVBUF_UNLOCK(so);
SOCK_IO_RECV_UNLOCK(so);
return (error);