(listen_v4, listen_v6): handle the case of the protocol not being
supported git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6690 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -76,6 +76,8 @@ listen_v4 (int port)
|
|||||||
|
|
||||||
s = socket(AF_INET, SOCK_STREAM, 0);
|
s = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
if(s < 0) {
|
if(s < 0) {
|
||||||
|
if (errno == ENOSYS)
|
||||||
|
return -1;
|
||||||
perror("socket");
|
perror("socket");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@@ -104,8 +106,10 @@ listen_v6 (int port)
|
|||||||
|
|
||||||
s = socket(AF_INET6, SOCK_STREAM, 0);
|
s = socket(AF_INET6, SOCK_STREAM, 0);
|
||||||
if(s < 0) {
|
if(s < 0) {
|
||||||
perror("socket");
|
if (errno == ENOSYS)
|
||||||
exit(1);
|
return -1;
|
||||||
|
perror("socket");
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
socket_set_reuseaddr (s, 1);
|
socket_set_reuseaddr (s, 1);
|
||||||
memset(&sa, 0, sizeof(sa));
|
memset(&sa, 0, sizeof(sa));
|
||||||
|
Reference in New Issue
Block a user