From patchwork Wed Apr 4 11:33:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 150720 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 8F1F3B6FFD for ; Wed, 4 Apr 2012 21:33:27 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1334144009; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:To:Cc:Subject:Date:Message-ID:User-Agent: MIME-Version:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=8dhWYOPG6ZMDl2QL3bG0P5pN09E=; b=eXrosPRzZEPM8Fy Fsfv6q4dUCJMmt3Rkos9Z0Y2ip2mNAGgAjFksf91zwJ5YJou5TBVaWLA26LB+ykx rUEYCSeMnTrMo4U7pZGaRz8h7R8wrkkcqWAOGfXiFh+iSNZ+QXkwylvA4JSJXK0V az91a8B2osRTRvxEFiAPOrZTw/o8= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:From:To:Cc:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=IQYlsDJ3TSfwLXlp66leVq618DblRdFuYPb046Kf91F+K91zfgDnJ1OYP805ZE gd36oT6UBKMCSLcSxfAm4HMYZfaO8MyCgkKkRcvavTmRImGtUID0ZUXdbBN7UXZG T4rjpnRDjIPmGtOjjLNW9f76mGTJKjYqvWBd0HyZRQ5aw=; Received: (qmail 3210 invoked by alias); 4 Apr 2012 11:33:23 -0000 Received: (qmail 3195 invoked by uid 22791); 4 Apr 2012 11:33:22 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL, BAYES_00, SARE_HTML_URI_LHOST31, TW_CP, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Apr 2012 11:33:09 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 846331B0; Wed, 4 Apr 2012 13:33:07 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 02mRUUV+lapd; Wed, 4 Apr 2012 13:33:05 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 362391AF; Wed, 4 Apr 2012 13:33:05 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.5+Sun/8.14.5/Submit) id q34BX4k9006747; Wed, 4 Apr 2012 13:33:04 +0200 (MEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: java-patches@gcc.gnu.org Subject: [libjava] Restore HAVE_INET6 tests (PR libgcj/52645) Date: Wed, 04 Apr 2012 13:33:04 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org It turns out I've been over-eager removing Tru64 UNIX support from libjava, breaking at least the HP-UX 11.00 build. The following patch fixes this, tested by Dave Anglin on hppa2.0w-hp-hpux11.00 and bootstrapped on i386-pc-solaris2.11. Ok for mainline? Thanks. Rainer 2012-03-21 Rainer Orth PR libgcj/52645 * gnu/java/net/natPlainDatagramSocketImplPosix.cc (setOption): Restore HAVE_INET6 check. * gnu/java/net/natPlainDatagramSocketImplWin32.cc (setOption): Likewise. # HG changeset patch # Parent e817b51d075737a1652e0b5630c8823a4b074cec Restore HAVE_INET6 tests (PR libgcj/52645) diff --git a/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc b/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc --- a/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc +++ b/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc @@ -655,6 +655,7 @@ gnu::java::net::PlainDatagramSocketImpl: len = sizeof (struct in_addr); ptr = (const char *) &u.addr; } +#ifdef HAVE_INET6 else if (len == 16) { level = IPPROTO_IPV6; @@ -663,6 +664,7 @@ gnu::java::net::PlainDatagramSocketImpl: len = sizeof (struct in6_addr); ptr = (const char *) &u.addr6; } +#endif else throw new ::java::net::SocketException (JvNewStringUTF ("invalid length")); diff --git a/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc b/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc --- a/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc +++ b/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc @@ -540,6 +540,7 @@ gnu::java::net::PlainDatagramSocketImpl: len = sizeof (struct in_addr); ptr = (const char *) &u.addr; } +#ifdef HAVE_INET6 else if (len == 16) { level = IPPROTO_IPV6; @@ -548,6 +549,7 @@ gnu::java::net::PlainDatagramSocketImpl: len = sizeof (struct in6_addr); ptr = (const char *) &u.addr6; } +#endif else throw new ::java::net::SocketException (JvNewStringUTF ("invalid length")); @@ -635,14 +637,14 @@ gnu::java::net::PlainDatagramSocketImpl: goto error; if (u.address.sin_family == AF_INET) { - laddr = JvNewByteArray (4); - memcpy (elements (laddr), &u.address.sin_addr, 4); + laddr = JvNewByteArray (4); + memcpy (elements (laddr), &u.address.sin_addr, 4); } #ifdef HAVE_INET6 - else if (u.address.sin_family == AF_INET6) + else if (u.address.sin_family == AF_INET6) { - laddr = JvNewByteArray (16); - memcpy (elements (laddr), &u.address6.sin6_addr, 16); + laddr = JvNewByteArray (16); + memcpy (elements (laddr), &u.address6.sin6_addr, 16); } #endif else