Removed dangerous exits
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
16
src/runner.c
16
src/runner.c
@@ -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]++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user