chiark / gitweb /
prefork-interp: wip, socket watch, etc.
[chiark-utils.git] / perl / Prefork.pm
index 2869caf4387c535cef068246eaecfee4e69e756e..a9fc4810ea6d67672d382fb24f524f1a928e86ea 100644 (file)
@@ -162,6 +162,9 @@ sub initialisation_complete {
     #---- setup (pm) [2], exits ----
     _exit(0);
   }
+  setsid() > 0 or fail_log("setsid: $!");
+  # The server will be a session leader, but it won't open ttys,
+  # so that is ok.
 
   #---- server(pm) [1] ----
 
@@ -177,7 +180,6 @@ sub initialisation_complete {
   # --- server(pm) [2] ----
 
   $fail_log = 1;
-  setsid() > 0 or fail_log("setsid: $!");
   open STDIN, "<&NULL" or fail_log("dup null onto stdin: $!");
   open STDOUT, ">&NULL" or fail_log("dup null onto stdout: $!");
   open STDERR, ">&NULL" or fail_log("dup null onto stderr: $!");