Skip to content
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

Report errno from libblkid code #906

Open
jlebon opened this issue Dec 19, 2019 · 0 comments
Open

Report errno from libblkid code #906

jlebon opened this issue Dec 19, 2019 · 0 comments

Comments

@jlebon
Copy link
Member

jlebon commented Dec 19, 2019

Right now, we're translating libblkid errors into generic codes like RESULT_OPEN_FAILED. But this doesn't capture why the operation failed. We should report the actual errno value too to make debugging easier.

Looking at the code, we're just translating that into an error string anyway, so it doesn't seem like we actually need to handle specific failure types differently. Because one cannot reliably access errno from Golang, one suggestion is to just do the error prefixing on the C side (this is what #846 did when it used the SELinux API directly before switching to setfiles: https://github.com/coreos/ignition/compare/d8772fbc6a61a4ddf9b47ff90feeaa12d0d38e34..af996492e367bebc0ddf0bc4e5f8d5cbf9749623#diff-e4e61a4b3c86fbfe43c406733947227dL77).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant