Author: jfrederic.clere(a)jboss.com
Date: 2007-08-21 05:57:19 -0400 (Tue, 21 Aug 2007)
New Revision: 953
Modified:
trunk/sight/native/include/sight_types.h
trunk/sight/native/os/linux/tcpstat.c
trunk/sight/native/os/linux/udpstat.c
trunk/sight/native/os/posix/group.c
trunk/sight/native/os/posix/user.c
trunk/sight/native/share/jnu.c
Log:
The union in sight_arr_t needs to have a name otherwise it
won't compile on Solaris compiler (and lot others).
Modified: trunk/sight/native/include/sight_types.h
===================================================================
--- trunk/sight/native/include/sight_types.h 2007-08-21 09:41:21 UTC (rev 952)
+++ trunk/sight/native/include/sight_types.h 2007-08-21 09:57:19 UTC (rev 953)
@@ -106,7 +106,7 @@
union {
char **ca;
jchar **wa;
- };
+ } arr;
} sight_arr_t;
typedef struct sight_object_t sight_object_t;
Modified: trunk/sight/native/os/linux/tcpstat.c
===================================================================
--- trunk/sight/native/os/linux/tcpstat.c 2007-08-21 09:41:21 UTC (rev 952)
+++ trunk/sight/native/os/linux/tcpstat.c 2007-08-21 09:57:19 UTC (rev 953)
@@ -174,9 +174,9 @@
/* Get the information corresponding to the second entry Tcp: */
for (i = 0; i < tgrp->siz; i++) {
- if (memcmp(tgrp->ca[i], "Tcp:", 4) == 0) {
- if (memcmp(tgrp->ca[i], "Tcp: RtoAlgorithm", 17) != 0) {
- sscanf(tgrp->ca[i], "Tcp: %d %d %d %d %d %d %d %d %d %d %d %d %d
%d",
+ if (memcmp(tgrp->arr.ca[i], "Tcp:", 4) == 0) {
+ if (memcmp(tgrp->arr.ca[i], "Tcp: RtoAlgorithm", 17) != 0) {
+ sscanf(tgrp->arr.ca[i], "Tcp: %d %d %d %d %d %d %d %d %d %d %d %d
%d %d",
&RtoAlgorithm, &RtoMin, &RtoMax, &MaxConn,
&ActiveOpens,
&PassiveOpens, &AttemptFails, &EstabResets,
&CurrEstab,
&InSegs, &OutSegs, &RetransSegs, &InErrs,
&OutRsts);
Modified: trunk/sight/native/os/linux/udpstat.c
===================================================================
--- trunk/sight/native/os/linux/udpstat.c 2007-08-21 09:41:21 UTC (rev 952)
+++ trunk/sight/native/os/linux/udpstat.c 2007-08-21 09:57:19 UTC (rev 953)
@@ -111,9 +111,9 @@
/* Get the information corresponding to the second entry Tcp: */
for (i = 0; i < tgrp->siz; i++) {
- if (memcmp(tgrp->ca[i], "Udp:", 4) == 0) {
- if (memcmp(tgrp->ca[i], "Udp: InDatagrams", 16) != 0) {
- sscanf(tgrp->ca[i], "Udp: %d %d %d %d %d %d",
+ if (memcmp(tgrp->arr.ca[i], "Udp:", 4) == 0) {
+ if (memcmp(tgrp->arr.ca[i], "Udp: InDatagrams", 16) != 0) {
+ sscanf(tgrp->arr.ca[i], "Udp: %d %d %d %d %d %d",
&InDatagrams, &NoPorts, &InErrors, &OutDatagrams,
&RcvbufErrors, &SndbufErrors);
break;
Modified: trunk/sight/native/os/posix/group.c
===================================================================
--- trunk/sight/native/os/posix/group.c 2007-08-21 09:41:21 UTC (rev 952)
+++ trunk/sight/native/os/posix/group.c 2007-08-21 09:57:19 UTC (rev 953)
@@ -157,7 +157,7 @@
goto cleanup;
}
/* 1. GroupName */
- token = sight_strtok_c(tgrp->ca[i], ':', &titer);
+ token = sight_strtok_c(tgrp->arr.ca[i], ':', &titer);
SET_IFIELD_S(0000, u, token);
/* 2. Password */
token = sight_strtok_c(NULL, ':', &titer);
@@ -208,7 +208,7 @@
char *titer;
/* 1. GroupName */
- gname = sight_strtok_c(tgrp->ca[i], ':', &titer);
+ gname = sight_strtok_c(tgrp->arr.ca[i], ':', &titer);
/* 2. Password */
token = sight_strtok_c(NULL, ':', &titer);
/* 3. GID */
Modified: trunk/sight/native/os/posix/user.c
===================================================================
--- trunk/sight/native/os/posix/user.c 2007-08-21 09:41:21 UTC (rev 952)
+++ trunk/sight/native/os/posix/user.c 2007-08-21 09:57:19 UTC (rev 953)
@@ -157,7 +157,7 @@
goto cleanup;
}
/* 1. UserName */
- token = sight_strtok_c(tusr->ca[i], ':', &titer);
+ token = sight_strtok_c(tusr->arr.ca[i], ':', &titer);
SET_IFIELD_S(0000, u, token);
/* 2. Password */
token = sight_strtok_c(NULL, ':', &titer);
@@ -205,7 +205,7 @@
char *titer;
/* 1. UserName */
- uname = sight_strtok_c(tusr->ca[i], ':', &titer);
+ uname = sight_strtok_c(tusr->arr.ca[i], ':', &titer);
/* 2. Password */
token = sight_strtok_c(NULL, ':', &titer);
/* 3. UID */
Modified: trunk/sight/native/share/jnu.c
===================================================================
--- trunk/sight/native/share/jnu.c 2007-08-21 09:41:21 UTC (rev 952)
+++ trunk/sight/native/share/jnu.c 2007-08-21 09:57:19 UTC (rev 953)
@@ -702,7 +702,7 @@
return NULL;
a->siz = 0;
a->len = init;
- if (!(a->ca = (char **)malloc(init * sizeof(char *)))) {
+ if (!(a->arr.ca = (char **)malloc(init * sizeof(char *)))) {
int saved = errno;
free(a);
a = NULL;
@@ -716,18 +716,18 @@
if (!str || !*str)
return 0; /* Skip empty and null strings */
if (a->siz < a->len) {
- a->ca[a->siz++] = strdup(str);
+ a->arr.ca[a->siz++] = strdup(str);
}
else {
char **na;
size_t len = a->len << 2;
if (!(na = (char **)malloc(len * sizeof(char *))))
return errno;
- memcpy(na, a->ca, a->siz * sizeof(char *));
- free(a->ca);
+ memcpy(na, a->arr.ca, a->siz * sizeof(char *));
+ free(a->arr.ca);
a->len = len;
- a->ca = na;
- a->ca[a->siz++] = strdup(str);
+ a->arr.ca = na;
+ a->arr.ca[a->siz++] = strdup(str);
}
return 0;
}
@@ -739,9 +739,9 @@
if (!a)
return;
for (i = 0; i < a->siz; i++) {
- SIGHT_FREE(a->ca[i]);
+ SIGHT_FREE(a->arr.ca[i]);
}
- free(a->ca);
+ free(a->arr.ca);
free(a);
}