applied Matthias-Christian Ott's remark about trailing newlines
This commit is contained in:
parent
8b2eeee541
commit
f3827eec2a
8
sic.c
8
sic.c
@ -220,23 +220,23 @@ main(int argc, char *argv[]) {
|
|||||||
if(i < 0) {
|
if(i < 0) {
|
||||||
if(errno == EINTR)
|
if(errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
die("error: error on select()");
|
die("error: error on select()\n");
|
||||||
}
|
}
|
||||||
else if(i == 0) {
|
else if(i == 0) {
|
||||||
if(time(NULL) - trespond >= PINGTIMEOUT)
|
if(time(NULL) - trespond >= PINGTIMEOUT)
|
||||||
die("error: sic shutting down: parse timeout");
|
die("error: sic shutting down: parse timeout\n");
|
||||||
write(srv, ping, strlen(ping));
|
write(srv, ping, strlen(ping));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(FD_ISSET(srv, &rd)) {
|
if(FD_ISSET(srv, &rd)) {
|
||||||
if(readl(srv, sizeof bufin, bufin) == -1)
|
if(readl(srv, sizeof bufin, bufin) == -1)
|
||||||
die("error: remote host closed connection");
|
die("error: remote host closed connection\n");
|
||||||
parsesrv(bufin);
|
parsesrv(bufin);
|
||||||
trespond = time(NULL);
|
trespond = time(NULL);
|
||||||
}
|
}
|
||||||
if(FD_ISSET(0, &rd)) {
|
if(FD_ISSET(0, &rd)) {
|
||||||
if(readl(0, sizeof bufin, bufin) == -1)
|
if(readl(0, sizeof bufin, bufin) == -1)
|
||||||
die("error: broken pipe");
|
die("error: broken pipe\n");
|
||||||
parsein(bufin);
|
parsein(bufin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user