Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix error handling
The behaviour on error of crypt(3) is tricky. The only real error it can return is {error,enosys} on platforms not supporting it (the old implementation would have returned {error, {crypt, "enosys"}}). Change the behaviour of the module to test for NULL before loading. If there is any error, there is no point loading the library. In the event of an error, the crypt implementation may choose to return NULL (crypt/2 will throw a bad arg exception) or return a fixed string (the caller will need to check for this case if it is a concern).
- Loading branch information
Showing
2 changed files
with
63 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters