From ce1a90d6391fb9f41faac5743102554fbdd84304 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Wed, 27 Jul 2022 14:37:32 -0700 Subject: [PATCH] [hal] Replace SerialHelper "goto done" with continue (#4342) The logic is already correct for closing all the objects. So we should just be continuing on error. --- hal/src/main/native/athena/cpp/SerialHelper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hal/src/main/native/athena/cpp/SerialHelper.cpp b/hal/src/main/native/athena/cpp/SerialHelper.cpp index 3831769a2e..fef92d4edc 100644 --- a/hal/src/main/native/athena/cpp/SerialHelper.cpp +++ b/hal/src/main/native/athena/cpp/SerialHelper.cpp @@ -193,7 +193,7 @@ void SerialHelper::QueryHubPaths(int32_t* status) { ViSession vSession; *status = viOpen(m_resourceHandle, desc, VI_NULL, VI_NULL, &vSession); if (*status < 0) - goto done; + continue; *status = 0; *status = viGetAttribute(vSession, VI_ATTR_INTF_INST_NAME, &osName); @@ -201,9 +201,9 @@ void SerialHelper::QueryHubPaths(int32_t* status) { // Use a separate close variable so we can check ViStatus closeStatus = viClose(vSession); if (*status < 0) - goto done; + continue; if (closeStatus < 0) - goto done; + continue; *status = 0; // split until (/dev/