mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
cpacfstatsd: replace goto cleanups
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 <mhartmay@linux.ibm.com> Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
22bce41dd7
commit
10f8565e32
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user