]> err.no Git - varnish/commitdiff
Be even more careful with server fd's
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 26 Jun 2008 22:55:25 +0000 (22:55 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 26 Jun 2008 22:55:25 +0000 (22:55 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2843 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishtest/vtc_server.c
varnish-cache/bin/varnishtest/vtc_varnish.c

index ee48866099896aa817b19306ac3924e30599a88e..d361eacf94f628c2afaddba392a46502a5d23e0e 100644 (file)
@@ -97,7 +97,7 @@ server_thread(void *priv)
                http_process(vl, s->spec, fd, 0);
                vtc_log(vl, 3, "shutting fd %d", fd);
                AZ(shutdown(fd, SHUT_WR));
-               AZ(shutdown(fd, SHUT_RD));
+               AZ(close(fd));
        }
        vtc_log(vl, 2, "Ending");
        return (NULL);
index b8e6897ed7697677a0d5b7fb0a6421beacb18e43..e2d41305e82e0b6937daea41cbd7a4f860767e9e 100644 (file)
@@ -205,6 +205,8 @@ varnish_launch(struct varnish *v)
                AZ(close(v->fds[1]));
                AZ(close(v->fds[2]));
                AZ(close(v->fds[3]));
+               for (i = 3; i <getdtablesize(); i++)
+                       close(i);
                AZ(execl("/bin/sh", "/bin/sh", "-c", vsb_data(vsb), NULL));
                exit(1);
        }