remember how || works in C

This commit is contained in:
James F. Carter
2018-01-10 13:54:26 +00:00
parent 1d5b315f17
commit 0c668f1776

View File

@@ -70,10 +70,13 @@ int sock_set_reuseaddr( int fd, int optval )
int sock_set_keepalive_params( int fd, int time, int intvl, int probes) int sock_set_keepalive_params( int fd, int time, int intvl, int probes)
{ {
return sock_set_keepalive(fd, 1) || if (sock_set_keepalive(fd, 1) ||
sock_set_tcp_keepidle(fd, time) || sock_set_tcp_keepidle(fd, time) ||
sock_set_tcp_keepintvl(fd, intvl) || sock_set_tcp_keepintvl(fd, intvl) ||
sock_set_tcp_keepcnt(fd, probes); sock_set_tcp_keepcnt(fd, probes)) {
return -1;
}
return 0;
} }
int sock_set_keepalive( int fd, int optval ) int sock_set_keepalive( int fd, int optval )