Removed dangerous exits

This commit is contained in:
Nate Choe
2022-02-27 22:56:44 -06:00
parent 9b5985940c
commit e60747a9f8
2 changed files with 11 additions and 8 deletions

View File

@@ -138,7 +138,6 @@ NULL
}
}
if (sitefile == NULL) {
fprintf(stderr, "No sitefile configured\n");
exit(EXIT_FAILURE);
@@ -230,7 +229,7 @@ NULL
lowestThread = i;
if (write(notify[lowestThread][1], &stream, sizeof(&stream))
< sizeof(&stream))
exit(EXIT_FAILURE);
continue;
}
}

View File

@@ -77,24 +77,28 @@ remove:
allocConns *= 2;
newfds = realloc(fds,
sizeof(struct pollfd) * allocConns);
if (newfds == NULL)
exit(EXIT_FAILURE);
if (newfds == NULL) {
allocConns /= 2;
continue;
}
fds = newfds;
newconns = realloc(connections,
sizeof(Connection) * allocConns);
if (newconns == NULL)
exit(EXIT_FAILURE);
if (newconns == NULL) {
allocConns /= 2;
continue;
}
connections = newconns;
}
if (read(notify, &newstream, sizeof(newstream))
< sizeof(newstream))
exit(EXIT_FAILURE);
continue;
fds[connCount].fd = newstream->fd;
fds[connCount].events = POLLIN;
if (newConnection(newstream, connections + connCount))
exit(EXIT_FAILURE);
continue;
connCount++;
pending[id]++;
}