Make peers close stdin when entering daemon mode.
authorFilippos Giannakos <philipgian@grnet.gr>
Mon, 15 Apr 2013 09:35:47 +0000 (12:35 +0300)
committerFilippos Giannakos <philipgian@grnet.gr>
Fri, 17 May 2013 08:57:55 +0000 (11:57 +0300)
(cherry picked from commit 04ea45339fd0e5a92c3290807805766acc1e7223)

xseg/peers/user/peer.c

index cefc089..b20e1b0 100644 (file)
@@ -861,6 +861,9 @@ int main(int argc, char *argv[])
        }
 
        if (daemonize){
+               if (close(STDIN_FILENO)){
+                       XSEGLOG2(&lc, W, "Could not close stdin");
+               }
                if (daemon(0, 1) < 0){
                        XSEGLOG2(&lc, E, "Cannot daemonize");
                        r = -1;