anchor.diff:  
   'PIPE'({_Port, {exit_status, 0}}, #fsm{port=Port}=S) ->
      lager:info("pipe terminated ~p", [Port]),
  -   {stop, normal, S};
  +   {next_state, 'IDLE', S};
   
   'PIPE'({_Port, {exit_status, Reason}},  #fsm{port=Port}=S) ->
      lager:error("pipe error ~p, peer ~p", [Reason, Port]),
  -   {stop, {error, Reason}, S};
  +   {emit,
  +      {error, Reason},
  +      'IDLE',
  +      S
  +   };
   
   'PIPE'({send, Data}, #fsm{port=Port}=S) ->
      lager:debug("pipe send ~p~n~p~n", [Port, Data]),
  
positive.code: ioctl(_, _) ->
     undefined.
  
  %%
  %%
  'PIPE'({_Port, {data, Data}}, #fsm{port=Port}=S) ->
  
negative.code: -include("knet.hrl").
  
  -export([init/1, free/2, ioctl/2]).
  -export(['IDLE'/2, 'PIPE'/2]).
  
  %%
  %%
  -record(fsm, {
  	exec,   %% executable
     args,   %% arguments
     port    %% communication port
  }).
  -define(PORT_OPTS, [binary, stream, exit_status]).
  
  %%
  %%
  init([Exec, Args]) ->
  	{ok, 
  	   'IDLE', 
  	   #fsm{
  	      exec = Exec,
  	      args = Args 
  	   }
  	}.
  
  