socket dismantling.
There is no way that close(2) should ever be able to return EINVAL,
but we've seen it.
Specifically assert on EBADF which is the check we're really after.
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@910
d4fa192b-c00b-0410-8231-
f00ffab90ce4
void
vca_close_session(struct sess *sp, const char *why)
{
+ int i;
VSL(SLT_SessionClose, sp->fd, why);
- if (sp->fd >= 0)
- AZ(close(sp->fd));
+ if (sp->fd >= 0) {
+ i = close(sp->fd);
+ assert(i == 0 || errno != EBADF); /* XXX EINVAL seen */
+ }
sp->fd = -1;
}