From b03748ac2c264f30c455878f28bf9a71b4cff893 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sat, 23 Sep 2017 23:45:39 -0600 Subject: [PATCH] another fix for #120 (sendto: invalid argument) --- lib/nodes/socket.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/nodes/socket.c b/lib/nodes/socket.c index 93df18f14..96fab8293 100644 --- a/lib/nodes/socket.c +++ b/lib/nodes/socket.c @@ -365,6 +365,9 @@ int socket_write(struct node *n, struct sample *smps[], unsigned cnt) if (ret < 0) return -1; + if (wbytes <= 0) + return 0; + /* Send message */ bytes = sendto(s->sd, data, wbytes, 0, (struct sockaddr *) &s->remote, sizeof(s->remote)); if (bytes < 0)