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

Fixed uname() query on Solaris. #2948

Merged
merged 2 commits into from
Mar 16, 2017
Merged

Fixed uname() query on Solaris. #2948

merged 2 commits into from
Mar 16, 2017

Conversation

roge
Copy link
Contributor

@roge roge commented Mar 15, 2017

Solaris returns "non-negative" result for uname() upon success.

See: http://www.unix.com/man-page/sunos/2/uname/

@roge
Copy link
Contributor Author

roge commented Mar 16, 2017

I would like to mention this is necessary for OSInfo to work correctly on Solaris, during my testing the "non-negative" result uname() returned was 1 not 0.

@mkrautz
Copy link
Contributor

mkrautz commented Mar 16, 2017

I checked some of the other Unix-like systems, and OpenBSD's man page also specifies a non-negative return value on success, but the libc implementation only ever returns 0.

@roge- I'm OK with the ifdef, but could you add a comment documenting why it's needed in the code?

#ifdef Q_OS_SOLARIS
    // Solaris's uname returns a non-negative number on success...
    [...]
#else
    // ...while other Unix-like systems only use 0 on success.
    [...]
 #endif

Copy link
Contributor

@mkrautz mkrautz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add comments inside the ifdefs as suggested in my comment.

@mkrautz mkrautz merged commit 6b7dfc7 into mumble-voip:master Mar 16, 2017
@mkrautz
Copy link
Contributor

mkrautz commented Mar 16, 2017

Merged, 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

Successfully merging this pull request may close these issues.

2 participants