chiark / gitweb /
prefork-interp: adjust $0
[chiark-utils.git] / perl / Prefork.pm
index f740251bee008a08e9cc2853f371e00c44fe982a..b671ef1d6dbfca33587d00aa6bb8e72d3ff50e63 100644 (file)
@@ -171,6 +171,7 @@ sub initialisation_complete {
   $child = fork // croak "second fork failed: $!";
   if (!$child) {
     # we are the child, i.e. the one fa-monitor
+    local $0 = "$0 [monitor(init)]";
     return become_monitor();
   }
 
@@ -195,6 +196,8 @@ sub initialisation_complete {
 
   my $errcount = 0;
 
+  local $0 = "$0 [server]";
+
   for (;;) {
     # reap children
     if (%children) {
@@ -239,6 +242,7 @@ sub initialisation_complete {
       $child = fork // fail_log("fork for accepted call failed: $!");
       if (!$child) {
        #---- monitor [1] ----
+       local $0 = "$0 [monitor]";
        become_monitor();
       }
       close(CALL);