1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

socket: treat EPERM as a warning (see #120)

This commit is contained in:
Steffen Vogel 2017-08-30 22:22:05 +02:00
parent 14c948cb92
commit 3c27971cc7

View file

@ -24,6 +24,7 @@
#include <sys/socket.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <errno.h>
#if defined(__linux__)
#include <netinet/ether.h>
@ -370,8 +371,12 @@ int socket_write(struct node *n, struct sample *smps[], unsigned cnt)
/* Send message */
bytes = sendto(s->sd, data, wbytes, 0, (struct sockaddr *) &s->remote, sizeof(s->remote));
if (bytes < 0)
serror("Failed send to node %s", node_name(n));
if (bytes < 0) {
if (errno == EPERM)
warn("Failed send to node %s: %s", node_name(n), strerror(errno));
else
serror("Failed send to node %s", node_name(n));
}
if (bytes != wbytes)
warn("Partial send to node %s", node_name(n));