Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 4634 invoked from network); 24 Feb 2009 13:22:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Feb 2009 13:22:03 -0000 Received: (qmail 31563 invoked by uid 500); 24 Feb 2009 13:22:03 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 31536 invoked by uid 500); 24 Feb 2009 13:22:03 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 31511 invoked by uid 99); 24 Feb 2009 13:22:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Feb 2009 05:22:02 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Feb 2009 13:22:02 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 02DB023888A5; Tue, 24 Feb 2009 13:21:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r747375 - /harmony/enhanced/classlib/branches/java6/modules/luni/src/main/native/luni/unix/helpers.c Date: Tue, 24 Feb 2009 13:21:41 -0000 To: commits@harmony.apache.org From: hindessm@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090224132142.02DB023888A5@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: hindessm Date: Tue Feb 24 13:21:41 2009 New Revision: 747375 URL: http://svn.apache.org/viewvc?rev=747375&view=rev Log: Workaround to compile on Aix and hopefully zOS with slight loss of functionality. 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=747375&r1=747374&r2=747375&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 Tue Feb 24 13:21:41 2009 @@ -42,6 +42,11 @@ #include "jclprots.h" #include "harmonyglob.h" +#if defined(LINUX) +#define HAS_RTNETLINK 1 +#endif + +#if defined(HAS_RTNETLINK) #include #include #include @@ -70,6 +75,7 @@ U_32 remainingLength; U_32 done; } netlinkContext_struct; +#endif int portCmp (const void **a, const void **b); @@ -486,6 +492,7 @@ jboolean isEmpty = JNI_TRUE; jbyteArray bytearray = NULL; +#if defined(SIOCGIFHWADDR) /* required call if we are going to call port library methods */ PORT_ACCESS_FROM_ENV (env); @@ -537,9 +544,11 @@ } close(fd); hymem_free_memory (interfaceName); +#endif return bytearray; } +#if defined(HAS_RTNETLINK) void initNetlinkContext (I_32 netlinkSocketHandle, struct netlinkContext_struct * netlinkContext) @@ -709,6 +718,7 @@ } } } +#endif I_32 getPlatformInterfaceAddresses(JNIEnv * env, @@ -717,15 +727,16 @@ interfaceAddressArray_struct* interfaceAddressArray) { interfaceAddress_struct *interfaces = NULL; - int counter = 0; + U_32 numAddresses = 0; +#if defined(HAS_RTNETLINK) + int counter = 0; U_8 addressFamily = 0; int netlinkSocketHandle = 0; netlinkContext_struct netlinkContext; struct addrReq_struct addrRequest; U_32 sendLength = 0; U_32 result = 0; - U_32 numAddresses = 0; struct nlmsghdr *currentNlHeader = NULL; struct ifaddrmsg *returnedAddrHeader = NULL; @@ -893,13 +904,15 @@ } - interfaceAddressArray -> length = numAddresses; - interfaceAddressArray -> elements = interfaces; - /* do any final clean up before returning */ close (netlinkSocketHandle); cleanupNetlinkContext(env, &netlinkContext); - return 0; + +#endif + interfaceAddressArray -> length = numAddresses; + interfaceAddressArray -> elements = interfaces; + + return 0; } I_32