Skip to content

aix: fix os.release() - #10245

Closed
jBarz wants to merge 3 commits into
nodejs:masterfrom
jBarz:master
Closed

aix: fix os.release()#10245
jBarz wants to merge 3 commits into
nodejs:masterfrom
jBarz:master

Conversation

@jBarz

@jBarzjBarz commented Dec 13, 2016

Copy link
Copy Markdown
Contributor
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

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lts-watch-v4.x labels Dec 13, 2016
Comment threadsrc/node_os.cc Outdated
}
# ifdef _AIX
char release[256];
sprintf(release, "%s.%s", info.version, info.release);

Copy link
Copy Markdown
Member

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?

@mscdexmscdex added aix Issues and PRs related to the AIX platform. os Issues and PRs related to the os subsystem. labels Dec 13, 2016
@Trott

Copy link
Copy Markdown
Member

Should we add a test for this? Currently in test/parallel/test-os.js, there's this:

constrelease=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 AIXif(common.isAix)assert.ok(/^\d+\.\d+\.\d+$/.test(release));// <-- substitute whatever regexp makes sense for AIX

@Trott

Trott commented Dec 13, 2016

Copy link
Copy Markdown
Member

The docs for os.release() say this:

On POSIX systems, the operating system release is determined by calling uname(3).

With this change, is that still accurate for AIX? (If so, then great. If not, then perhaps a doc update should be included.)

@gibfahn

Copy link
Copy Markdown
Member

cc/ @nodejs/platform-aix

@richardlau

Copy link
Copy Markdown
Member

The docs for os.release() say this:

On POSIX systems, the operating system release is determined by calling uname(3).

With this change, is that still accurate for AIX? (If so, then great. If not, then perhaps a doc update should be included.)

Yes, the change is still accurate -- The code is still calling uname but is now combining two fields instead of just returning one. On AIX it looks like unamesplits the OS version over two struct utsname fields, e.g. AIX 7.1 returns 7 in the version field and 1 in the release field.

@mhdawsonmhdawson left a comment

Copy link
Copy Markdown
Member

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.

@mhdawson

Copy link
Copy Markdown
Member

@Trott look ok to you now ?

@Trott

Copy link
Copy Markdown
Member

@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.)

@jasnell

Copy link
Copy Markdown
Member

@jasnelljasnell self-assigned this Dec 23, 2016
jasnell pushed a commit that referenced this pull request Dec 27, 2016
PR-URL: #10245
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell

Copy link
Copy Markdown
Member

Landed in 1c3c75d

@jasnelljasnell closed this Dec 27, 2016
@evanlucasevanlucas mentioned this pull request Jan 3, 2017
evanlucas pushed a commit that referenced this pull request Jan 3, 2017
PR-URL: #10245
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
evanlucas pushed a commit that referenced this pull request Jan 4, 2017
PR-URL: #10245
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 23, 2017
PR-URL: #10245
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 23, 2017
PR-URL: #10245
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 23, 2017
PR-URL: #10245
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
PR-URL: #10245
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
PR-URL: #10245
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This was referenced Jan 24, 2017
MylesBorins pushed a commit that referenced this pull request Jan 31, 2017
PR-URL: #10245
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Feb 1, 2017
PR-URL: #10245
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aixIssues and PRs related to the AIX platform.c++Issues and PRs that require attention from people who are familiar with C++.osIssues and PRs related to the os subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@jBarz@Trott@gibfahn@richardlau@mhdawson@jasnell@cjihrig@mscdex@MylesBorins@nodejs-github-bot