...
|
...
|
@@ -108,7 +108,11 @@ static int isremote(const struct optstruct *opts) {
|
108
|
108
|
}
|
109
|
109
|
memcpy((void *)&testsock, (void *)&tcpsock, sizeof(testsock));
|
110
|
110
|
testsock.sin_port = htons(INADDR_ANY);
|
111
|
|
- if(!(s = socket(testsock.sin_family, SOCK_STREAM, 0))) return 0;
|
|
111
|
+ if((s = socket(testsock.sin_family, SOCK_STREAM, 0)) < 0) {
|
|
112
|
+ logg("isremote: socket() returning: %s.\n", strerror(errno));
|
|
113
|
+ mainsa = NULL;
|
|
114
|
+ return 0;
|
|
115
|
+ }
|
112
|
116
|
ret = (bind(s, (struct sockaddr *)&testsock, sizeof(testsock)) != 0);
|
113
|
117
|
closesocket(s);
|
114
|
118
|
return ret;
|