sendto: don't clear transient errors for atomic protocols
authorGleb Smirnoff <glebius@FreeBSD.org>
Thu, 17 Feb 2022 17:07:31 +0000 (09:07 -0800)
committerGleb Smirnoff <glebius@FreeBSD.org>
Wed, 23 Feb 2022 18:24:14 +0000 (10:24 -0800)
commitd2b3a0ed31ef6270c712d0779a95bb222df88909
tree00f824bde3c40ea182eec579f3780336d3f30254
parente0ac9dc2b069c309c0dc18d3170d9883c421bfd9
sendto: don't clear transient errors for atomic protocols

The changeset 65572cade35 uncovered the fact that top layer of sendto(2)
would clear a transient error code if some data was copied out of uio.
The clearing of the error makes sense for non-atomic protocols, since
they have sent some data.  The atomic protocols send all or nothing.

The current implementation of unix/dgram uses sosend_generic(), which
would always copyout and only then it may fail to deliver a message.
The sosend_dgram(), currently used by UDP only, also has same behavior.

Reported by: pho
Reviewed by: pho, markj
Differential revision: https://reviews.freebsd.org/D34309
sys/kern/uipc_syscalls.c