dfork: clean up forking logic

Call setsid() once only to make sure we get a process that is not a
session leader or process group leader, and hence cannot acquire a
controlling terminal.

It looks like setpgid() (or setpgrp()) is used only when setsid() is not
available.

It looks like the call to ioctl() is necessary only for 4.3BSD.

(Patch modified by Lennart Poettering)
1 file changed