From 10f8565e32b041eb4f669bc1c4fbbdd771585e7e Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Tue, 30 May 2023 08:28:16 +0000 Subject: [PATCH] cpacfstatsd: replace `goto cleanup`s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are only two users of the `cleanup` label, so let's replace the goto statements with the label code. This makes the code easier to read. Especially since another label will be introduced in the next commit. Signed-off-by: Marc Hartmayer Reviewed-by: Ingo Franzki Signed-off-by: Jan Höppner --- cpacfstats/cpacfstatsd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cpacfstats/cpacfstatsd.c b/cpacfstats/cpacfstatsd.c index 57b27831..ed496df7 100644 --- a/cpacfstats/cpacfstatsd.c +++ b/cpacfstats/cpacfstatsd.c @@ -513,7 +513,8 @@ int main(int argc, char *argv[]) rc = recv_query(s, &ctr, &cmd); if (rc != 0) { eprint("Recv_query() failed, ignoring\n"); - goto cleanup; + close(s); + continue; } if (cmd == ENABLE) @@ -527,11 +528,9 @@ int main(int argc, char *argv[]) else { eprint("Received unknown command %d, ignoring\n", (int) cmd); - goto cleanup; + close(s); + continue; } - -cleanup: - close(s); } if (stopsig == SIGTERM)