Add ERR_add_platform()#9072
Add ERR_add_platform()#9072richsalz wants to merge 3 commits intoopenssl:masterfrom richsalz:add-err-platform
Conversation
|
Strongly support this idea. |
|
travis has docnits error |
|
As the author of doc-nits I hang my had in shame. Then I lift my head, do a fix, and push a new commit. I should probably write a test, too. |
|
@beldmit I thought about always adding errno, but for some platforms it's not always errno, but WASsocketerror, and it's up to the caller to do the right thing. |
|
Added a test. |
|
This has a test, travis should be okay, and it's rebased. Ping for reviews. |
|
I find the new name non-intuitive. How about |
|
Okay. Rename commit pushed. |
|
weekly bump |
|
1.5 fortnights. ping. |
|
Rebased and force-pushed. Now that #9058 has been merged, I think this becomes even more useful, being able to say what (C runtime, usually) function failed. It improves our error messages. As far as I know, there are no open issues with this PR. |
|
Unfortunately this is API break - you cannot change the meaning of the SYSerr argument as that is a public header macro. The workaround is to add a new macro and use it instead of SYSerr. |
|
Additional commit pushed; change SYSerr to FUNCerr and restored old definition of SYSerr, but deprecated it.
|
|
I guess if SYSerr is public, then the function codes it uses should also be handled like the other function codes.
Additional commit pushed.
|
t8m
left a comment
There was a problem hiding this comment.
I slightly dislike the FUNCerr name as it looks quite generic and something that could collide with other code but as that is a bikesheading nitpick I approve anyway.
|
@t8m this improves the case for new names for the error raising functions..... |
|
|
|
Travis failure is a time-out, unrelated to this. This seems ready to merge now. |
Change SYSerr to have the function name; remove SYS_F_xxx defines Add a test and documentation. Use get_last_socket_err, which removes some ifdef's in OpenSSL code.
Change SYSerr to have the function name; remove SYS_F_xxx defines Add a test and documentation. Use get_last_socket_err, which removes some ifdef's in OpenSSL code. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Richard Levitte <[email protected]> (Merged from #9072)
Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Richard Levitte <[email protected]> (Merged from #9072)
Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Richard Levitte <[email protected]> (Merged from #9072)
This is related to #9058 (comment) and also a bit to #8887. If the OMC decides to remove the function name from error codes, as that comment thread points out, it is still useful to report what function failed if it's something on the platform; e.g., "gethostbyname" failed, or what have you. This PR enables that. It adds a new function,
ERR_add_platformwhich takes a string name for the platform-provided function that failed, and reports that as "extra data" in the error stack. All theSYS_F_xxxvalues are gone.