You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by od...@apache.org on 2009/02/25 14:20:41 UTC

svn commit: r747771 - /harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c

Author: odeakin
Date: Wed Feb 25 13:20:41 2009
New Revision: 747771

URL: http://svn.apache.org/viewvc?rev=747771&view=rev
Log:
If SIOCGIFMTU is not defined on a platform, just return a default value (0 for now - workaround for zOS platform).
Commit also reorganises a previous commit (747375) slightly.

Modified:
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c?rev=747771&r1=747770&r2=747771&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c (original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c Wed Feb 25 13:20:41 2009
@@ -431,13 +431,14 @@
 jint
 getPlatformMTU(JNIEnv * env, jstring ifname, jint index)
 {
-       struct ifconf ifc;
-	char buff[2048];
-	int fd, i, n, result;
-	struct ifreq *ifr = NULL;
-	char * interfaceName = 0;	
-       int mtu = 0;
-	
+   int mtu = 0;
+#ifdef SIOCGIFMTU
+   struct ifconf ifc;
+   char buff[2048];
+   int fd, i, n, result;
+   struct ifreq *ifr = NULL;
+   char * interfaceName = 0;	
+
 	/* required call if we are going to call port library methods */
 	PORT_ACCESS_FROM_ENV (env);
 
@@ -475,24 +476,24 @@
 	}	
 	close(fd);
 	hymem_free_memory (interfaceName);	
+#endif
 	return mtu;
 }
 
 jbyteArray 
 getPlatformHardwareAddress(JNIEnv * env, jstring ifname, jint index)
 {
-       const int MAC_ADDR_SIZE = 6;
-
+    jbyteArray bytearray = NULL;
+#if defined(SIOCGIFHWADDR)
+    const int MAC_ADDR_SIZE = 6;
 	struct ifconf ifc;
 	char buff[2048];
 	int fd, i, j, n, result;
 	struct ifreq *ifr = NULL;
 	char * interfaceName = 0;
 	char array[MAC_ADDR_SIZE];
-	jboolean isEmpty = JNI_TRUE;        
-	jbyteArray bytearray = NULL;
+	jboolean isEmpty = JNI_TRUE; 
 
-#if defined(SIOCGIFHWADDR)
 	/* required call if we are going to call port library methods */
 	PORT_ACCESS_FROM_ENV (env);