[hackers] [quark] If fork fails, close the incoming socket || Laslo Hunhold
commit 72aa1646f69fc738b8df2afaa1b8f4ae9df4c68f
Author: Laslo Hunhold <dev_AT_frign.de>
AuthorDate: Fri Feb 23 22:40:47 2018 +0100
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Fri Feb 23 22:40:47 2018 +0100
If fork fails, close the incoming socket
diff --git a/main.c b/main.c
index 754299a..28b5163 100644
--- a/main.c
+++ b/main.c
_AT_@ -237,13 +237,13 @@ main(int argc, char *argv[])
/* fork and handle */
switch ((spid = fork())) {
- case -1:
- warn("fork:");
- continue;
case 0:
serve(infd, &in_sa);
exit(0);
break;
+ case -1:
+ warn("fork:");
+ /* fallthrough */
default:
/* close the connection in the parent */
close(infd);
Received on Fri Feb 23 2018 - 22:40:55 CET
This archive was generated by hypermail 2.3.0
: Fri Feb 23 2018 - 22:48:22 CET