iscsi-scstd: daemon handle EOF (rc == 0) from nl_fd

Daemon now handles receipt of EOF (rc == 0) from nl_fd.  Probably this never
happens in a real kernel build, but it does during shutdown in a usermode build
and it seems like it is "generically correct" in either case.

Signed-off-by: David Butterfield <dab21774@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7140 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2017-04-21 01:04:16 +00:00
parent 344387c40e
commit 82f5ffd255

View File

@@ -1066,6 +1066,15 @@ retry:
goto retry;
log_error("read netlink fd (%d) failed: %s", fd, strerror(errno));
exit(1);
} else if (rc == 0) {
/*
* EOF on nl_fd --
* We arrive here after the kernel module closes the other end
* of nl_fd during shutdown of the kernel modules. The daemon
* thread is expected to exit when this happens.
*/
log_info("kernel module shutdown -- daemon exits");
exit(1);
}
log_debug(1, "target %u, session %#" PRIx64 ", conn %u, code %u, cookie %d",