Changeset 146 for trunk


Ignore:
Timestamp:
Sep 5, 2010, 8:21:09 PM (15 years ago)
Author:
dmik
Message:

jdk: Return correct values for os.name, os.version, sun.os.patch.level and sun.desktop properties.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openjdk/jdk/src/windows/native/java/lang/java_props_md.c

    r86 r146  
    2323 * have any questions.
    2424 */
     25
     26#ifdef __WIN32OS2__
     27#define INCL_DOSMISC
     28#include <os2wrap2.h>
     29#endif
    2530
    2631#include <windows.h>
     
    687692    /* OS properties */
    688693    {
     694#ifdef __WIN32OS2__
     695        /* When reporting the OS name and version, we omit the fact that we run
     696         * under Odin (that would report itself as a Windows system) and return
     697         * the actual OS/2 values which makes more sense. */
     698
     699        char buf[100];
     700
     701        sprops.os_name = "OS/2";
     702
     703        os2_ULONG ver[3];
     704        DosQuerySysInfo(os2_QSV_VERSION_MAJOR, os2_QSV_VERSION_REVISION,
     705                        &ver, sizeof(ver));
     706        sprintf(buf, "%lu.%lu", ver[0], ver[1]);
     707        sprops.os_version = strdup(buf);
     708        sprintf(buf, "%lu", ver[3]);
     709        sprops.patch_level = strdup(buf);
     710
     711        sprops.os_arch = "x86";
     712        sprops.desktop = "pm";
     713#else /* __WIN32OS2__ */
    689714        char buf[100];
    690715        OSVERSIONINFOEX ver;
     
    830855
    831856        sprops.desktop = "windows";
     857#endif /* __WIN32OS2__ */
    832858    }
    833859
Note: See TracChangeset for help on using the changeset viewer.