Fixed multiple connections
This commit is contained in:
@@ -124,8 +124,11 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
fsync(fd);
|
||||||
|
//TODO: Find out why this works
|
||||||
if (schedule[0] == -1) {
|
if (schedule[0] == -1) {
|
||||||
int newfd = accept(fd, (struct sockaddr *) &addr, &addrlen);
|
int newfd = accept(fd, (struct sockaddr *) &addr,
|
||||||
|
&addrlen);
|
||||||
if (newfd < 0)
|
if (newfd < 0)
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
int flags = fcntl(newfd, F_GETFL);
|
int flags = fcntl(newfd, F_GETFL);
|
||||||
|
|||||||
Reference in New Issue
Block a user