ctdb-common: Fix error handling
authorMartin Schwenke <martin@meltin.net>
Mon, 24 Jun 2019 06:36:47 +0000 (16:36 +1000)
committerAmitay Isaacs <amitay@samba.org>
Fri, 5 Jul 2019 05:03:24 +0000 (05:03 +0000)
commit271d96e4fcae7228e460cba558041f4656588f22
tree721a2eb79bdd493711c49c21af0d71a8ea2089fe
parent0ab5d5cece2b7d22cabfffd090cf3c675dca4af5
ctdb-common: Fix error handling

According to the documentation, sendto() should either send the packet
as given or return with an error.  However, given that it can return
the number of bytes sent, treat the theoretical error of a short
packet send separately, since errno would not be set in this case.

Similarly, treat a short packet recv() separately from an error where
errno is set.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/common/system_socket.c