Lines 53-59
Link Here
|
53 |
l = sizeof(sa); |
53 |
l = sizeof(sa); |
54 |
rv = getpeername(fd, &sa, &l); |
54 |
rv = getpeername(fd, &sa, &l); |
55 |
/* Solaris 2.5 getpeername() returns EINVAL if the fd is not a socket. */ |
55 |
/* Solaris 2.5 getpeername() returns EINVAL if the fd is not a socket. */ |
56 |
return ((rv < 0 && (errno == ENOTSOCK || errno == EINVAL)) ? 0 : 1); |
56 |
/* Darwin 7.7.0 getpeername() returns ENOTCONN if the fd was created with pipe(). */ |
|
|
57 |
return ((rv < 0 && (errno == ENOTSOCK || errno == ENOTCONN || errno == EINVAL)) ? 0 : 1); |
57 |
#else /* !HAVE_GETPEERNAME || SVR4_2 || __BEOS__ */ |
58 |
#else /* !HAVE_GETPEERNAME || SVR4_2 || __BEOS__ */ |
58 |
# if defined (SVR4) || defined (SVR4_2) |
59 |
# if defined (SVR4) || defined (SVR4_2) |
59 |
/* Sockets on SVR4 and SVR4.2 are character special (streams) devices. */ |
60 |
/* Sockets on SVR4 and SVR4.2 are character special (streams) devices. */ |