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 disk model under FreeBSD #52

Closed
danfe opened this issue May 17, 2021 · 6 comments
Closed

Report disk model under FreeBSD #52

danfe opened this issue May 17, 2021 · 6 comments

Comments

@danfe
Copy link

danfe commented May 17, 2021

I've added your program to FreeBSD ports and had to patch it a bit so it reports disk model correctly; would be nice if you could merge the patch, it's rather small and simple. Of course, I've forgotten to close(fd) before returning from the function. :-(

@JonMagon
Copy link
Owner

Hi! Thank you. Why is there sys/fcntl.h included? Maybe it is better to use QFile, which is already included in diskdriveinfo.cpp?

@danfe
Copy link
Author

danfe commented May 17, 2021

Why is there sys/fcntl.h included?

To get O_RDONLY definition. Should've probably be spelled as simply fcntl.h though.

Maybe it is better to use QFile, which is already included in diskdriveinfo.cpp?

Isn't QFile mainly for reading and writing files, while here we open device node to call ioctl() on it?

@JonMagon
Copy link
Owner

JonMagon commented May 17, 2021

Isn't QFile mainly for reading and writing files, while here we open device node to call ioctl() on it?

Oh right, I read the code wrong. I'll create a commit.

@danfe
Copy link
Author

danfe commented May 17, 2021

Thanks! I forgot to mention that close(2) needs #include <unistd.h> but I guess that can wait for another day.

@JonMagon
Copy link
Owner

I couldn't check, is it okay now?

@danfe
Copy link
Author

danfe commented May 17, 2021

Yup, it's fine, thanks!

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

2 participants