From 76bd7bd882d260a15de1bf97e8ef583af494fbef Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Mon, 30 Aug 2021 14:39:26 +0200 Subject: [PATCH] Removed goto --- src/raspberrypi/rascsi.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/raspberrypi/rascsi.cpp b/src/raspberrypi/rascsi.cpp index 758c0d68..f6e1efdc 100644 --- a/src/raspberrypi/rascsi.cpp +++ b/src/raspberrypi/rascsi.cpp @@ -1319,22 +1319,19 @@ int main(int argc, char* argv[]) // Output the Banner Banner(argc, argv); - int ret = 0; int port = 6868; if (!InitBus()) { - ret = EPERM; - goto init_exit; + return EPERM; } if (!ParseArgument(argc, argv, port)) { - ret = EINVAL; - goto err_exit; + Cleanup(); + return -1; } if (!InitService(port)) { - ret = EPERM; - goto init_exit; + return EPERM; } // Reset @@ -1454,10 +1451,5 @@ int main(int argc, char* argv[]) active = false; } -err_exit: - // Cleanup - Cleanup(); - -init_exit: - return ret; + return 0; }