If fork fails, close the incoming socket - quark - quark web server
(HTM) git clone git://git.suckless.org/quark
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 72aa1646f69fc738b8df2afaa1b8f4ae9df4c68f
(DIR) parent 53c3963497dbf82c3f4f085d5cd97b8b0941c29e
(HTM) Author: Laslo Hunhold <dev@frign.de>
Date: Fri, 23 Feb 2018 22:40:47 +0100
If fork fails, close the incoming socket
Diffstat:
M main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/main.c b/main.c
@@ -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);