prim_file fixes

Kostis Sagonas kostis@REDACTED
Sat Feb 5 12:12:14 CET 2011


The documentation of erlang:open_port/2 states:

   open_port(PortName, PortSettings) -> port()
     where
       PortName = {spawn, Command} | ...
       Command = string()

while in prim_file.erl there are calls to this function (via drv_open/2)

drv_open(Driver, Portopts) ->
     try erlang:open_port({spawn, Driver}, Portopts) of     % line 821
         ....

where the Driver is an atom and dialyzer does not like that.
This comes from the use of the ?FD_DRV macro.

Change this macro from:

    -define(FD_DRV, efile).
to
    -define(FD_DRV, "efile").

While at it, do some cosmetic cleanups.

Fetch by:

   git fetch git://github.com/kostis/otp.git  prim_file-fixes


Kostis


More information about the erlang-patches mailing list