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:
parent
14c948cb92
commit
3c27971cc7
1 changed files with 7 additions and 2 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Reference in a new issue