Re: [PATCH 5/5] daemon: new option --detach to run git-daemon in background From: Edgar Toernig <hidden> Date: 2016-06-15 22:42:33 Matthias Lederhofer wrote: [daemonize] + if ((devnull = open("/dev/null", O_RDWR, 0)) == -1) + die("open /dev/null failed: %s", strerror(errno)); + if (dup2(devnull, 0) != 0 || + dup2(devnull, 1) != 1 || + dup2(devnull, 2) != 2) + die("dup2 failed: %s", strerror(errno)); +} Hmm... leaks devnull. Why not simply close(0/1/2) and let sanitize_stdfds take care of the rest? Ciao, ET.
Keyboard shortcuts hback out one level jnext message in thread kprevious message in thread ldrill in Escclose help / fold thread tree ?toggle this help