From patchwork Wed Jul 13 20:45:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zack Weinberg X-Patchwork-Id: 648047 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rqW8H1T62z9sDf for ; Thu, 14 Jul 2016 06:46:23 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=QHSMuogh; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=KS+uzzADaLhFVpOeDGm+xtNOtUuOEYG pII3VePC6HM3/jzW34PSloDWxN73rwqA7sCX26itlxB5/Z9FhOPDOkIICs4RHoc4 VcHESAEQW0SF3C3KK4QEcEtHRNVHvpoMVY1sUrM4wztgoJ4UT/d8lVAZv4lreKQr ACKAo6Tpqoxc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=dBbirdEyF1DuYOSbICRQE7bUjbk=; b=QHSMu oghzs25QVzbSejwLEsNl7in6S1FoPvIGxKPM8YSa7JBkC2iX9WTVII1Dp7J69loq yBszqHv/LSxi9HbTb4cpXls+/6hjfTMDyMDsNf+RTCp+PCtdQfzneLufSU2xeXTO UeVd+UddB0gcrd0inbev2L692zTid4onte4/Yo= Received: (qmail 27695 invoked by alias); 13 Jul 2016 20:46:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 27426 invoked by uid 89); 13 Jul 2016 20:46:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=Duplicate, Client X-HELO: mailbackend.panix.com From: Zack Weinberg To: libc-alpha@sourceware.org Subject: [PATCH 2/4] Installed-header compilation hygiene, 2/4 (struct osockaddr). Date: Wed, 13 Jul 2016 16:45:59 -0400 Message-Id: <2af4c6fd5f5c6e98426e2d5c967a7341dbca19e2.1468441534.git.zackw@panix.com> In-Reply-To: References: This is a little ugly, but I don't see a cleaner alternative, and it only affects things that probably nobody uses anymore anyway. zw BZ #20366, 2/4 (struct osockaddr) * socket/sys/socket.h: Only define struct osockaddr if not already defined; guard macro is __struct_osockaddr_defined. * inet/protocols/talkd.h: Duplicate definition of struct osockaddr here, also guarded by __struct_osockaddr_defined. --- inet/protocols/talkd.h | 12 ++++++++++++ socket/sys/socket.h | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/inet/protocols/talkd.h b/inet/protocols/talkd.h index 34e2654..99b241b 100644 --- a/inet/protocols/talkd.h +++ b/inet/protocols/talkd.h @@ -54,6 +54,18 @@ #include #include +#ifndef __struct_osockaddr_defined +/* This is the 4.3 BSD `struct sockaddr' format, which is used as wire + format in the grotty old 4.3 `talk' protocol. It's also defined in + sys/socket.h, but only under __USE_MISC. */ +struct osockaddr + { + unsigned short int sa_family; + unsigned char sa_data[14]; + }; +# define __struct_osockaddr_defined +#endif + /* * Client->server request message format. */ diff --git a/socket/sys/socket.h b/socket/sys/socket.h index c9f0f50..dfdd8cd 100644 --- a/socket/sys/socket.h +++ b/socket/sys/socket.h @@ -38,13 +38,17 @@ __BEGIN_DECLS #include #ifdef __USE_MISC +# ifndef __struct_osockaddr_defined /* This is the 4.3 BSD `struct sockaddr' format, which is used as wire - format in the grotty old 4.3 `talk' protocol. */ + format in the grotty old 4.3 `talk' protocol. It is also defined, + unconditionally, in protocols/talkd.h. */ struct osockaddr { unsigned short int sa_family; unsigned char sa_data[14]; }; +# define __struct_osockaddr_defined +# endif #endif /* The following constants should be used for the second parameter of