aboutsummaryrefslogtreecommitdiff
path: root/seatd/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'seatd/server.c')
-rw-r--r--seatd/server.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/seatd/server.c b/seatd/server.c
index 354d6a5..799fda0 100644
--- a/seatd/server.c
+++ b/seatd/server.c
@@ -120,9 +120,10 @@ static int set_nonblock(int fd) {
static int server_handle_connection(int fd, uint32_t mask, void *data) {
struct server *server = data;
if (mask & (EVENT_ERROR | EVENT_HANGUP)) {
- close(fd);
+ shutdown(fd, SHUT_RDWR);
+ server->running = false;
log_errorf("server socket recieved an error: %s", strerror(errno));
- exit(1);
+ return -1;
}
if (mask & EVENT_READABLE) {