summary refs log tree commit diff
path: root/hittpd.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2020-05-07 22:41:55 +0200
committerLeah Neukirchen <leah@vuxu.org>2020-05-07 22:41:55 +0200
commit47f7cdd0d250421de68ebae1b7b1d989100b2bba (patch)
treea8b492da8fdddfec4746a43cfc40297a86c10696 /hittpd.c
parentf7e682a3cf4ab843572145c25d9bce99a6c6857f (diff)
downloadhittpd-47f7cdd0d250421de68ebae1b7b1d989100b2bba.tar.gz
hittpd-47f7cdd0d250421de68ebae1b7b1d989100b2bba.tar.xz
hittpd-47f7cdd0d250421de68ebae1b7b1d989100b2bba.zip
more fatal errors on startup
Diffstat (limited to 'hittpd.c')
-rw-r--r--hittpd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/hittpd.c b/hittpd.c
index 51ea109..f0cff7a 100644
--- a/hittpd.c
+++ b/hittpd.c
@@ -853,13 +853,17 @@ main()
 	servaddr.sin6_addr = in6addr_any;
 
 	r = bind(listenfd, (struct sockaddr *)&servaddr, sizeof servaddr);
-	if (r < 0)
-	    perror("bind");
+	if (r < 0) {
+		perror("bind");
+		exit(111);
+	}
 
 	errno = 0;
 	r = listen(listenfd, 32);
-	if (r < 0)
-	    perror("listen");
+	if (r < 0) {
+		perror("listen");
+		exit(111);
+	}
 
 	client[0].fd = listenfd;
 	client[0].events = POLLRDNORM;