[master] b9d8f84be Make it clear to Coverity what's going on.

Poul-Henning Kamp phk at FreeBSD.org
Mon Feb 8 09:03:08 UTC 2021


commit b9d8f84be5dff170e88702b1adaf6dca3d36f424
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Feb 8 09:01:24 2021 +0000

    Make it clear to Coverity what's going on.
    
    (If it wasnt because vtcp has spread to other code I would
    assert that the fd is larger than stderr.)

diff --git a/lib/libvarnish/vtcp.c b/lib/libvarnish/vtcp.c
index 4ba37a19e..1c4996b21 100644
--- a/lib/libvarnish/vtcp.c
+++ b/lib/libvarnish/vtcp.c
@@ -390,7 +390,7 @@ vtcp_open_callback(void *priv, const struct suckaddr *sa)
 
 	errno = 0;
 	fd = VTCP_connect(sa, (int)floor(vto->timeout * 1e3));
-	if (fd > 0) {
+	if (fd >= 0) {
 		vto->fd = fd;
 		vto->latest_errno = 0;
 		return (1);


More information about the varnish-commit mailing list