samples: ipc: icmsg: Do not return busy error codes

When sending a lot of data, a busy error code returned by the IPC is to
be expected. But if the last attempted send returns busy, this error
code is returned to the calling function, causing an error log message.
Fix this by setting return variable to 0 on this acceptable error.

Signed-off-by: Celina Sophie Kalus <hello@celinakalus.de>
This commit is contained in:
Celina Sophie Kalus 2024-05-02 14:30:17 +02:00 committed by Anas Nashif
commit 7da8ca3113

View file

@ -68,6 +68,7 @@ static int send_for_time(struct ipc_ept *ep, const int64_t sending_time_ms)
ret = ipc_service_send(ep, &msg, mlen); ret = ipc_service_send(ep, &msg, mlen);
if (ret == -ENOMEM) { if (ret == -ENOMEM) {
/* No space in the buffer. Retry. */ /* No space in the buffer. Retry. */
ret = 0;
continue; continue;
} else if (ret < 0) { } else if (ret < 0) {
LOG_ERR("Failed to send (%c) failed with ret %d", msg.data[0], ret); LOG_ERR("Failed to send (%c) failed with ret %d", msg.data[0], ret);