mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
[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.
This commit is contained in:
@@ -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/
|
||||
|
||||
Reference in New Issue
Block a user