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

Minor code updates #243

Merged
merged 6 commits into from
Jan 29, 2024
Merged

Minor code updates #243

merged 6 commits into from
Jan 29, 2024

Conversation

SergiiDmytruk
Copy link
Contributor

While making this project work on BSD systems (in limited capacity) I stumbled upon some things in the code which you might want to fix. Of course, there were more changes related to compatibility, but given that the project is targeting Linux I've skipped them and submitting only those which make sense to apply in general.

Avoids NULL dereference.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
The API prescribes use of setmntent().

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Don't include <byteswap.h> and use __builtin_bswap16() in one place.
It's already used in the rest of places, this just completes the
transition to the builtin.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
I don't think it's being used.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
<uchar.h> is glibc-specific and it's not even guaranteed to be 2 bytes
long!

  typedef __uint_least16_t char16_t;

uint16_t seems much more appropriate here.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
@macpijan
Copy link

macpijan commented Aug 3, 2023

@vathpela Hi, any chance to take a look at this? If merged, this would reduce code differences a bit, which should help with maintenance and broader usage of this tool not only in Linux, but also in BSD systems.

@vathpela vathpela merged commit 4f3da3d into rhboot:main Jan 29, 2024
@macpijan macpijan deleted the code-updates branch January 30, 2024 11:02
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

Successfully merging this pull request may close these issues.

3 participants