You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/04/13 16:26:03 UTC

svn commit: r764486 - /commons/sandbox/runtime/trunk/src/main/native/os/hpux/os.c

Author: mturk
Date: Mon Apr 13 14:26:02 2009
New Revision: 764486

URL: http://svn.apache.org/viewvc?rev=764486&view=rev
Log:
Return id on hp-ux for hardware

Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/hpux/os.c

Modified: commons/sandbox/runtime/trunk/src/main/native/os/hpux/os.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/hpux/os.c?rev=764486&r1=764485&r2=764486&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/hpux/os.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/hpux/os.c Mon Apr 13 14:26:02 2009
@@ -103,7 +103,15 @@
 
 ACR_JNI_EXPORT_DECLARE(jstring, OS, getHardwarePlatform)(ACR_JNISTDARGS)
 {
-    return CSTR_TO_JSTRING(unknown);
+    char string[MAXSIZESYSSTRING];
+    struct utsname sys;
+    if (!uname(&sys)) {
+        strcpy(string, "id");
+        strcat(string, sys.idname);
+        return CSTR_TO_JSTRING(string);
+    }
+    else
+        return CSTR_TO_JSTRING(unknown);
 }
 
 ACR_JNI_EXPORT_DECLARE(jint, OS, getDataModel)(ACR_JNISTDARGS)