anchor.diff:          false -> Sh
       end;
   handle_msg({'EXIT', Pid, {error, Rc, StopAcc}},
  -           _Proc, Sh=#sh{id=Id, shutdown_port=Pid, log=Fd}) ->
  +           _Proc, Sh=#sh{id=Id,
  +                         shutdown_port=SPort,
  +                         log=Fd}) when Pid == SPort ->
       log({framework, Id},
           "termination Port stopped abnormally (status ~p)~n", [Rc]),
       io:format(Fd, "Halt Log ==============~n~s~n", [StopAcc]),
  
positive.code: handle_msg({Port, closed}, _Proc, Sh=#sh{id=Id, port=Port}) ->
      log({framework, Id}, "~p closed~n", [Port]),
      {stop, {port_closed, Port}, Sh};
  handle_msg({'EXIT', Pid, {ok, StopAcc}}, _Proc, Sh=#sh{shutdown_port=Pid,
                                                         detached=Detached,
                                                         state=killed,
                                                         log=Fd,
                                                         id=Id}) ->
      log({framework, Id}, "termination Port completed ok~n"),
      io:format(Fd, "Halt Log ==============~n~s~n", [StopAcc]),
      case Detached of
  
negative.code:     argv,
      environment
  }).
  
  -define(IS_DYING(State),
          State =:= killed orelse State =:= stopped).
  
  -include("systest.hrl").
  
  