Hello,<br><br><p>
I am testing Varnish (<a class="changeset" href="http://varnish-cache.org/changeset/4576" title="Tell FlexeLint 
that we ignore returnvalues on purpose.">r4576</a>) in Solaris 10 5.10 
Generic_120011-14 sun4v sparc SUNW,Sun-Fire-T2000. <br>
We are planning to use a cache like Varnish or Squid and I have followed
 the instructions in <a class="ext-link" href="http://letsgetdugg.com/2009/12/04/varnish-on-solaris/"><span class="icon"> </span>http://letsgetdugg.com/2009/12/04/varnish-on-solaris/</a>
</p>

I have the same LINGER crash like in <a class="closed ticket" href="http://varnish-cache.org/ticket/660" title="defect: Varnish LINGER
 crash in tcp.c (closed: duplicate)">#660</a> that has the same root 
cause in <a class="new ticket" href="http://varnish-cache.org/ticket/649" title="defect: Varnish LINGER
 crash on Solaris (new)">#649</a> <br><br>I have trying to fix the bug and I have found <strong>the problem is 
that solaris setsockopt returns sometimes EINVAL</strong> when it is no 
invalid parameters, problem found in Java JVM in Solaris:<br>
* <a class="ext-link" href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6378870"><span class="icon"> </span>http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6378870</a>
  <br>
* <a class="ext-link" href="http://bugs.opensolaris.org/bugdatabase/view_bug.do;jsessionid=7141b1811572e415779f4a711a96?bug_id=6850464"><span class="icon"> </span>http://bugs.opensolaris.org/bugdatabase/view_bug.do;jsessionid=7141b1811572e415779f4a711a96?bug_id=6850464</a>
<br><br>I think the solution is to changed the definition of "TCP_Check" in <b>libvarnish.h</b> only for Solaris<strong><br><br><span style="font-family: courier new,monospace;">/* In Solaris OS, errno == EINVAL is OK because setsockopt(3SOCKET) call returns EINVAL when the connection is reset. */</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">#if defined (__SVR4) && defined (__sun) </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">#define TCP_Check(a) ((a) == 0 || errno == ECONNRESET || errno == ENOTCONN || errno == EINVAL)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">#else</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">#define TCP_Check(a) ((a) == 0 || errno == ECONNRESET || errno == ENOTCONN)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">#endif</span><br style="font-family: courier new,monospace;"><br><span style="font-weight: normal;">Do you think it is ok to commit it to trunk ?<br><br>Thank you<br></span></strong>