From ba8f56dfbbe97ff026b552e071a9a9e7bcd536e9 Mon Sep 17 00:00:00 2001 From: Michael Black Date: Wed, 15 Apr 2020 09:37:22 -0500 Subject: [PATCH] Change sync_cb to encompass the entire transaction Testing to see if the fixes the problem with Flex rigs --- tests/rigctl_parse.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index a55ac93e1..725495d98 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -1542,7 +1542,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, #endif // HAVE_LIBREADLINE - if (sync_cb) { sync_cb(1); } /* lock if necessary */ + if (sync_cb) sync_cb(1); /* lock if necessary */ if (!prompt) { @@ -1600,9 +1600,13 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, p2 ? p2 : "", p3 ? p3 : ""); - if (sync_cb) { sync_cb(0); } /* unlock if necessary */ - if (retcode == RIG_EIO) { return retcode; } + if (retcode == RIG_EIO) + { + if (sync_cb) sync_cb(0); /* unlock if necessary */ + + return retcode; + } if (retcode != RIG_OK) { @@ -1645,6 +1649,8 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, fflush(fout); + if (sync_cb) sync_cb(0); /* unlock if necessary */ + if (retcode == -RIG_ENAVAIL) { return retcode;