Skip to content

Commit 744df4d

Browse files
committed
remove goto
1 parent 9cf9009 commit 744df4d

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

kirc.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@ main(int argc, char **argv) {
257257
fds[0].events = POLLIN;
258258
fds[1].events = POLLIN;
259259

260-
int return_code = 0;
261-
262260
for (;;) {
263261
int poll_res = poll(fds, 2, -1);
264262

@@ -270,18 +268,14 @@ main(int argc, char **argv) {
270268
if (fds[1].revents & POLLIN) {
271269
int rc = handle_server_message();
272270
if (rc != 0) {
273-
if (rc == -2) return_code = EXIT_FAILURE;
274-
goto end;
271+
if (rc == -2) return EXIT_FAILURE;
272+
return 0;
275273
};
276274
}
277275
} else {
278276
if (errno == EAGAIN) continue;
279277
perror("poll");
280-
return_code = EXIT_FAILURE;
281-
goto end;
278+
return EXIT_FAILURE;
282279
}
283280
}
284-
285-
end:
286-
return return_code;
287281
}

0 commit comments

Comments
 (0)