Fix more sysctl(3) argument sizes and correct a comment.

Approved by:	glewis (implicit)
This commit is contained in:
Jung-uk Kim 2007-05-30 21:36:23 +00:00
parent 0632411f36
commit 8982638840
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=192424
2 changed files with 62 additions and 10 deletions

View file

@ -1,16 +1,42 @@
--- ../../j2se/src/solaris/bin/java_md.c.orig Thu May 24 19:15:46 2007
+++ ../../j2se/src/solaris/bin/java_md.c Thu May 24 19:14:59 2007
@@ -1061,7 +1061,8 @@
--- ../../j2se/src/solaris/bin/java_md.c.orig Fri May 25 21:49:14 2007
+++ ../../j2se/src/solaris/bin/java_md.c Wed May 30 17:00:23 2007
@@ -1060,8 +1060,9 @@
#if defined(_ALLBSD_SOURCE)
uint64_t result;
- uint64_t result;
- int mib[2], rlen;
+ unsigned long result;
+ int mib[2];
+ size_t rlen;
/* fetch sysctl(hw.physmem) value */
mib[0] = CTL_HW;
@@ -1635,7 +1636,7 @@
@@ -1342,10 +1343,11 @@
#if defined(_ALLBSD_SOURCE)
- unsigned long result, sys_processors;
- int mib[2], rlen;
+ unsigned long sys_processors;
+ int mib[2], result;
+ size_t rlen;
- /* fetch sysctl(hw.physmem) value */
+ /* fetch sysctl(hw.ncpu) value */
mib[0] = CTL_HW;
mib[1] = HW_NCPU;
rlen = sizeof(result);
@@ -1354,7 +1356,7 @@
result = 1;
if (_launcher_debug) {
- printf("sysctl(hw.ncpu): %lu\n", result);
+ printf("sysctl(hw.ncpu): %d\n", result);
}
sys_processors = result;
@@ -1635,7 +1637,7 @@
while (dp != NULL) {
cp = strchr(dp, (int)':');
if (cp != NULL)

View file

@ -1,16 +1,42 @@
--- ../../j2se/src/solaris/bin/java_md.c.orig Thu May 24 19:15:46 2007
+++ ../../j2se/src/solaris/bin/java_md.c Thu May 24 19:14:59 2007
@@ -1061,7 +1061,8 @@
--- ../../j2se/src/solaris/bin/java_md.c.orig Fri May 25 21:49:14 2007
+++ ../../j2se/src/solaris/bin/java_md.c Wed May 30 17:00:23 2007
@@ -1060,8 +1060,9 @@
#if defined(_ALLBSD_SOURCE)
uint64_t result;
- uint64_t result;
- int mib[2], rlen;
+ unsigned long result;
+ int mib[2];
+ size_t rlen;
/* fetch sysctl(hw.physmem) value */
mib[0] = CTL_HW;
@@ -1635,7 +1636,7 @@
@@ -1342,10 +1343,11 @@
#if defined(_ALLBSD_SOURCE)
- unsigned long result, sys_processors;
- int mib[2], rlen;
+ unsigned long sys_processors;
+ int mib[2], result;
+ size_t rlen;
- /* fetch sysctl(hw.physmem) value */
+ /* fetch sysctl(hw.ncpu) value */
mib[0] = CTL_HW;
mib[1] = HW_NCPU;
rlen = sizeof(result);
@@ -1354,7 +1356,7 @@
result = 1;
if (_launcher_debug) {
- printf("sysctl(hw.ncpu): %lu\n", result);
+ printf("sysctl(hw.ncpu): %d\n", result);
}
sys_processors = result;
@@ -1635,7 +1637,7 @@
while (dp != NULL) {
cp = strchr(dp, (int)':');
if (cp != NULL)