diff --git a/src/node_os.cc b/src/node_os.cc index 8b8c7b62c8518c..fb62c768a4e31f 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -83,7 +83,14 @@ static void GetOSRelease(const FunctionCallbackInfo& args) { if (uname(&info) < 0) { return env->ThrowErrnoException(errno, "uname"); } +# ifdef _AIX + char release[256]; + snprintf(release, sizeof(release), + "%s.%s", info.version, info.release); + rval = release; +# else rval = info.release; +# endif #else // Windows char release[256]; OSVERSIONINFOW info; diff --git a/test/parallel/test-os.js b/test/parallel/test-os.js index 15fd189f9be20e..7d653ff04e8c90 100644 --- a/test/parallel/test-os.js +++ b/test/parallel/test-os.js @@ -62,6 +62,9 @@ assert.ok(type.length > 0); var release = os.release(); console.log('release = ', release); assert.ok(release.length > 0); +//TODO: Check format on more than just AIX +if (common.isAix) + assert.ok(/^\d+\.\d+$/.test(release)); var platform = os.platform(); console.log('platform = ', platform);