-
Notifications
You must be signed in to change notification settings - Fork 254
Add strerrno(), and use it instead of its pattern #1375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3eb6818 to
ad1c40c
Compare
Signed-off-by: Alejandro Colomar <alx@kernel.org>
ad1c40c to
3519a8c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to update the unit test build configuration to include strerrno.c in the build for the test_xaprintf target, since that test uses exit_if_null.h which now depends on strerrno().
That should make CI green.
3519a8c to
415166c
Compare
Good eye. Thanks! :) |
bd24414 to
d296200
Compare
Signed-off-by: Alejandro Colomar <alx@kernel.org>
d296200 to
619a2ff
Compare
|
CI is passing now, @ikerexxe . |
Signed-off-by: Alejandro Colomar <alx@kernel.org>
619a2ff to
785ca7b
Compare
ikerexxe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Merging.
@ikerexxe , as you said you like this more than the addition of eprintf(), I've split these two patches from the other larger PR, so that this can be merged earlier.
Revisions:
v1b
v1c
v1d
v2
Use a macro instead of an inline function. This makes sure this doesn't create hidden dependencies between source files. Now we can remove the dependency in the unit tests for xaprintf().
I was using the inline function to const-ify the return value, as strerror(3) returns non-const (but can't be modified) which is dangerous. But we have const_cast(), which allows us to do the same in macros, so do that.
v3
v3b
v4