-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
aix: fix os.release() #10245
aix: fix os.release() #10245
Conversation
@@ -85,7 +85,13 @@ static void GetOSRelease(const FunctionCallbackInfo<Value>& args) { | |||
if (uname(&info) < 0) { | |||
return env->ThrowErrnoException(errno, "uname"); | |||
} | |||
# ifdef _AIX | |||
char release[256]; | |||
sprintf(release, "%s.%s", info.version, info.release); |
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.
Maybe use snprintf
for consistency with the rest of this file?
Should we add a test for this? Currently in const release = os.release();
console.log('release = ', release);
is.string(release);
assert.ok(release.length > 0); Maybe add something like this right below it? //TODO: Check format on more than just AIX
if (common.isAix)
assert.ok(/^\d+\.\d+\.\d+$/.test(release)); // <-- substitute whatever regexp makes sense for AIX |
The docs for
With this change, is that still accurate for AIX? (If so, then great. If not, then perhaps a doc update should be included.) |
cc/ @nodejs/platform-aix |
Yes, the change is still accurate -- The code is still calling |
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. Would be nice to fill in additional test for other platforms, but since this is broken on AIX, don't want to hold up landing this for that.
@Trott look ok to you now ? |
@mhdawson Test looks good to me. (The C++ change seems good to me too but I'm a beginner-at-best C++ coder so that probably doesn't mean much.) |
PR-URL: #10245 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in 1c3c75d |
PR-URL: #10245 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #10245 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #10245 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #10245 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #10245 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #10245 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #10245 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #10245 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #10245 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Checklist
make -j4 test
(UNIX)Affected core subsystem(s)
os.release() on aix
Description of change
On AIX info.release is only a part of OS release version.
We need to combine info.version and info.release