socket: Simplify SOL_TCP check

Rather than checking for the names of OSes that don't implement it
just check whether the define is available directly.
This commit is contained in:
Sitsofe Wheeler
2016-01-30 08:12:28 +00:00
parent 4714e12e8f
commit 6ea30f9fb2

View File

@@ -140,7 +140,7 @@ static int set_tcp_sockopt(int sockfd, int optname, int value)
{
int level;
#if defined(__FreeBSD__) || defined(__sun) || (defined(__APPLE__) && defined(__MACH__))
#ifndef SOL_TCP
struct protoent *buf;
if ((buf = getprotobyname("tcp")) != NULL)