Driver init failure not detected

Sean Hinde Sean.Hinde@REDACTED
Tue Oct 30 11:27:45 CET 2001

> >The init function of struct driver_entry is not used for dynamic
> >drivers. See erl_ddll(3) for the details.
> >
> >/Peter
> The truth is that init is indeed called when a dynamic driver 
> is loaded (it 
> is done so in the add_driver_entry function in the emulator). But the 
> return code from init is ignored. My feeling about this is 
> that this is 
> wrong, and that the return code should be checked, and the 
> emulator (or 
> erl_ddll) should unload the driver if init returns -1. But for now it 
> doesn't. You'll have to set some error variable and check 
> this later on.

It is certainly called, and I totally agree that the return value should be
checked (though what happens now is just that the following open_port call
fails safely so it is not as bad as it could be). Thanks for the tip - I'll
grunge something up for now :)


This email (including attachments) is confidential.  If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents.  We cannot accept liability for any breaches of
confidence arising through use of email.  Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions.  We will not accept responsibility for any commitments
made by our employees outside the scope of our business.  We do not warrant
the accuracy or completeness of such information.

More information about the erlang-questions mailing list