gen_server:format_status/2 only works with registered processes

Vance Shipley vances@REDACTED
Fri Mar 21 00:04:37 CET 2003


OK, I found the problem.  The following patch to lists.erl does it:

*** lists.erl.dist      Thu Mar 20 17:56:16 2003
--- lists.erl   Thu Mar 20 17:58:26 2003
***************
*** 280,285 ****
--- 280,286 ----
  thing_to_list(X) when integer(X) -> integer_to_list(X);
  thing_to_list(X) when float(X)         -> float_to_list(X);
  thing_to_list(X) when atom(X)  -> atom_to_list(X);
+ thing_to_list(X) when pid(X)   -> pid_to_list(X);
  thing_to_list(X) when list(X)  -> X.          %Assumed to be a string
  
  %% flatten(List)



	-Vance

Vance Shipley
Motivity Telecom Inc.
+1 519 240 3684
vances@REDACTED

On Thu, Mar 20, 2003 at 04:36:04PM -0500, Vance Shipley wrote:
}  
}  Now the problem is that, at least in R9B-[0|1], this only works if the
}  process is registered!  In the following example I am peeking at a 
}  couple gen_server processes the system runs.  I am referring to each
}  by PID but the process which is not registerd fails.
...
}  Error in process <0.25.0> with exit value: {function_clause,[{lists,thing_to_list,[<0.23.0>]},{lists,flatmap,2},{gen_server,format_status,2},{erl_eval,expr,3},{erl_eval,exprs,4},{shell,eval_loop,2}]}
}  



More information about the erlang-patches mailing list