runcmd: use tevent_re_initialise() to close sockets
authorAndrew Tridgell <tridge@samba.org>
Mon, 19 Apr 2010 07:14:33 +0000 (17:14 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 19 Apr 2010 08:21:42 +0000 (18:21 +1000)
this ensures that all event fds are closed in the child

lib/util/util_runcmd.c

index 54643d3292c1979389b63a42fdea80a5a1384970..d81a0ace93981d871baf99e5b2ee8e31cb3ec1ff 100644 (file)
@@ -160,6 +160,10 @@ struct tevent_req *samba_runcmd_send(TALLOC_CTX *mem_ctx,
        close(1);
        close(2);
 
+       /* we want to ensure that all of the network sockets we had
+          open are closed */
+       tevent_re_initialise(ev);
+
        /* setup for logging to go to the parents debug log */
        open("/dev/null", O_RDONLY); /* for stdin */
        dup2(p1[1], 1);