Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 1
    The double fork prevents zombie processes by forcing the kernel to set its parent to PID 1, which is supposed to clean up zombies. It sounds like Transmission already does it, since its parent is already process 1. Commented Jun 3, 2012 at 21:48
  • 1
    There are multiple problems here. #1: Only the parent should call exit(3); the children should call _exit(2) instead (otherwise you get multiple stdio flushes, among other issues). #2: That execvp(3) could use a perror(3) if it fails. #3: You should just use signal(SIGCHLD, SIG_IGN) instead of this whole mess. Commented Sep 22, 2015 at 20:40