I would like to apply the following changes
Christos Zoulas
christos at zoulas.com
Fri Jan 23 08:28:55 PST 2009
Hello,
I would like to apply the following changes:
1. NetBSD uses statfvs
2. passing possibly negative values to isdigit is undefined behavior:
http://www.opengroup.org/onlinepubs/009695399/functions/isdigit.html
3. passing possibly negative values to isspace is undefined behavior:
http://www.opengroup.org/onlinepubs/009695399/functions/isspace.html
4. last is possibly uninitialized.
5. recvfrom argument should be socklen_t not int:
http://www.opengroup.org/onlinepubs/007908775/xns/recvfrom.html
6. NetBSD uses <net/if_ether.h>
1, 6 are NetBSD specific, the rest should be applied to everyone.
Ok to commit?
Thanks,
christos
diff -r fc30e7f4b9b3 src/solaris/native/java/io/UnixFileSystem_md.c
--- a/src/solaris/native/java/io/UnixFileSystem_md.c Fri Jan 16 11:24:18 2009 -0500
+++ b/src/solaris/native/java/io/UnixFileSystem_md.c Mon Jan 22 16:25:36 2009 -0500
@@ -47,6 +47,9 @@
#define readdir64 readdir
#define stat64 stat
#endif
+#ifdef __NetBSD__
+#define statfs statvfs
+#endif
/* -- Field IDs -- */
diff -r fc30e7f4b9b3 src/solaris/native/java/lang/UNIXProcess_md.c
--- a/src/solaris/native/java/lang/UNIXProcess_md.c Fri Jan 16 11:24:18 2009 -0500
+++ b/src/solaris/native/java/lang/UNIXProcess_md.c Mon Jan 22 16:25:36 2009 -0500
@@ -377,7 +377,7 @@
*/
while ((dirp = readdir(dp)) != NULL) {
int fd;
- if (isdigit(dirp->d_name[0]) &&
+ if (isdigit((unsigned char)dirp->d_name[0]) &&
(fd = strtol(dirp->d_name, NULL, 10)) >= from_fd + 2)
close(fd);
}
diff -r fc30e7f4b9b3 src/solaris/native/java/net/Inet4AddressImpl.c
--- a/src/solaris/native/java/net/Inet4AddressImpl.c Fri Jan 16 11:24:18 2009 -0500
+++ b/src/solaris/native/java/net/Inet4AddressImpl.c Mon Jan 22 16:25:36 2009 -0500
@@ -155,7 +155,7 @@
* Workaround for Solaris bug 4160367 - if a hostname contains a
* white space then 0.0.0.0 is returned
*/
- if (isspace(hostname[0])) {
+ if (isspace((unsigned char)hostname[0])) {
JNU_ThrowByName(env, JNU_JAVANETPKG "UnknownHostException",
(char *)hostname);
JNU_ReleaseStringPlatformChars(env, host, hostname);
@@ -172,7 +172,7 @@
return NULL;
} else {
int i = 0;
- struct addrinfo *itr, *last, *iterator = res;
+ struct addrinfo *itr, *last = NULL, *iterator = res;
while (iterator != NULL) {
int skip = 0;
itr = resNew;
@@ -603,7 +603,8 @@
ping4(JNIEnv *env, jint fd, struct sockaddr_in* him, jint timeout,
struct sockaddr_in* netif, jint ttl) {
jint size;
- jint n, len, hlen1, icmplen;
+ jint n, hlen1, icmplen;
+ socklen_t len;
char sendbuf[1500];
char recvbuf[1500];
struct icmp *icmp;
diff -r fc30e7f4b9b3 src/solaris/native/java/net/NetworkInterface.c
--- a/src/solaris/native/java/net/NetworkInterface.c Fri Jan 16 11:24:18 2009 -0500
+++ b/src/solaris/native/java/net/NetworkInterface.c Mon Jan 22 16:25:36 2009 -0500
@@ -55,6 +55,8 @@
#include <net/if_var.h>
#elif defined(__OpenBSD__)
#include <netinet/if_ether.h>
+#elif defined(__NetBSD__)
+#include <net/if_ether.h>
#endif
#include <net/if_dl.h>
#include <netinet/in_var.h>
More information about the bsd-port-dev
mailing list