From 495dbc1aa65ceeb5fc1f5e0867aa00fa67568872 Mon Sep 17 00:00:00 2001 From: Bjarne von Horn Date: Thu, 6 Jun 2024 13:55:40 +0200 Subject: [PATCH] Fix return value for ecrt_master_send_ext(). --- include/ecrt.h | 1 + master/master.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/ecrt.h b/include/ecrt.h index 00e2eb8c..0d545dc5 100644 --- a/include/ecrt.h +++ b/include/ecrt.h @@ -1110,6 +1110,7 @@ EC_PUBLIC_API int ecrt_master_receive( * This method has to be called in the send callback function passed via * ecrt_master_callbacks() to allow the sending of non-application datagrams. * \return Zero on success, otherwise negative error code. + * \retval -EAGAIN Lock could not be acquired, try again later. */ int ecrt_master_send_ext( ec_master_t *master /**< EtherCAT master. */ diff --git a/master/master.c b/master/master.c index 5b320d92..cda6eda9 100644 --- a/master/master.c +++ b/master/master.c @@ -2534,7 +2534,7 @@ int ecrt_master_send_ext(ec_master_t *master) ec_datagram_t *datagram, *next; if (down_trylock(&master->ext_queue_sem)) - return; + return -EAGAIN; list_for_each_entry_safe(datagram, next, &master->ext_datagram_queue, ext_queue) {