From 979d2adccf7e7f76821d8c760808341b29f0fd2f Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Fri, 19 Jul 2024 23:10:10 -0500 Subject: [PATCH] On EBUSY write we'll do 2 retries with 200ms wait --- src/rig.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rig.c b/src/rig.c index d61f46831..4725e83fc 100644 --- a/src/rig.c +++ b/src/rig.c @@ -8601,6 +8601,8 @@ void *async_data_handler(void *arg) } else { + static int busy_retry=2; +again: result = write_block_sync(RIGPORT(rig), frame, frame_length); if (result < 0) @@ -8608,6 +8610,10 @@ void *async_data_handler(void *arg) // TODO: error handling? can writing to a pipe really fail in ways we can recover from? rig_debug(RIG_DEBUG_ERR, "%s: write_block_sync() failed, result=%d\n", __func__, result); + if (result == EBUSY && --busy_retry>0) { // we can try again + hl_usleep(200*1000); + goto again; + } continue; } }