diff --git a/port.c b/port.c index 6104061..48fff1c 100644 --- a/port.c +++ b/port.c @@ -2737,8 +2737,10 @@ int port_forward_to(struct port *p, struct ptp_message *msg) { int cnt; cnt = transport_sendto(p->trp, &p->fda, TRANS_GENERAL, msg); - if (cnt <= 0) { - return -1; + if (cnt < 0) { + return cnt; + } else if (!cnt) { + return -EIO; } port_stats_inc_tx(p, msg); return 0; diff --git a/port.h b/port.h index a45a7a4..e347e36 100644 --- a/port.h +++ b/port.h @@ -94,7 +94,7 @@ int port_forward(struct port *p, struct ptp_message *msg); * Forward a message on a given port to the address stored in the message. * @param port A pointer previously obtained via port_open(). * @param msg The message to send. Must be in network byte order. - * @return Zero on success, non-zero otherwise. + * @return Zero on success, negative errno value otherwise. */ int port_forward_to(struct port *p, struct ptp_message *msg);