Workaround (leftover?) events after disable iSNS server

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4472 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2012-08-24 18:54:35 +00:00
parent 19153e3a65
commit 7b77e66b07

View File

@@ -971,6 +971,14 @@ static int scn_accept_connection(void)
socklen_t slen;
int fd, err, opt = 1;
if (isns_server == NULL) {
/*
* Sometimes we have (leftover?) events after disable iSNS
* server, so ignore them
*/
goto out;
}
slen = sizeof(from);
fd = accept(scn_listen_fd, &from.sa, &slen);
if (fd < 0) {
@@ -989,6 +997,7 @@ static int scn_accept_connection(void)
scn_fd = fd;
isns_set_fd(isns_fd, scn_listen_fd, scn_fd);
out:
return 0;
}