s4-lib/socket: Return the original EMSGSIZE when sendto() and setsockopt() both fail
authorAndrew Bartlett <abartlet@samba.org>
Mon, 4 Mar 2013 03:07:38 +0000 (14:07 +1100)
committerKarolin Seeger <kseeger@samba.org>
Wed, 6 Mar 2013 09:16:39 +0000 (10:16 +0100)
commit755f6a392f9c6f3ce6bfad9cf44bd98af7be327b
tree5d8b70e1c1091aedd514d53f2983dc7fa82fa2c2
parente43fbb0cb7c67a0f7a29be02ed326f865993f117
s4-lib/socket: Return the original EMSGSIZE when sendto() and setsockopt() both fail

This ensures that should we be unable to increase the socket size, we return an
error that the application layer above might expect and be able to make
as reasonable response to (such as switching to a stream-based transport).

This fixes up c692bb02b039ae8fef6ba968fd13b36ad7d62a72.

As suggested by metze in https://bugzilla.samba.org/show_bug.cgi?id=9697#c4

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 50b42d1c5bb19e3a5050d7d23ac96e273d3974ee)
source4/lib/socket/socket_unix.c