From patchwork Wed Jul 13 20:46:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zack Weinberg X-Patchwork-Id: 13784 Received: (qmail 26741 invoked by alias); 13 Jul 2016 20:46:06 -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 25771 invoked by uid 89); 13 Jul 2016 20:46:05 -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=Hx-languages-length:2005, letter X-HELO: mailbackend.panix.com From: Zack Weinberg To: libc-alpha@sourceware.org Subject: [PATCH 3/4] Installed-header compilation hygiene, 3/4 (struct ifreq). Date: Wed, 13 Jul 2016 16:46:00 -0400 Message-Id: <2177539979b298afd190082839761d7bb66c5af8.1468441534.git.zackw@panix.com> In-Reply-To: References: It's unclear to me whether this is the right change, or whether instead net/if.h's definition of struct ifreq should be unconditional. This has the smaller set of side effects. net/if_ppp.h declares itself to be imported from an external source, but that last happened in 1996 so I think it's probably a dead letter. The Linux and Hurd versions of this file are identical, perhaps they should be un-sysdep-ified. zw BZ #20366, 2/4 (struct ifreq) * sysdeps/mach/hurd/net/if_ppp.h * sysdeps/unix/sysv/linux/net/if_ppp.h: Only define struct ifpppstatsreq and struct ifpppcstatsreq if __USE_MISC is defined. --- sysdeps/mach/hurd/net/if_ppp.h | 3 +++ sysdeps/unix/sysv/linux/net/if_ppp.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sysdeps/mach/hurd/net/if_ppp.h b/sysdeps/mach/hurd/net/if_ppp.h index 1b1c3ea..d95d247 100644 --- a/sysdeps/mach/hurd/net/if_ppp.h +++ b/sysdeps/mach/hurd/net/if_ppp.h @@ -119,6 +119,8 @@ struct ppp_option_data { int transmit; }; +/* 'struct ifreq' is only available from net/if.h under __USE_MISC. */ +#ifdef __USE_MISC struct ifpppstatsreq { struct ifreq b; struct ppp_stats stats; /* statistic information */ @@ -131,6 +133,7 @@ struct ifpppcstatsreq { #define ifr__name b.ifr_ifrn.ifrn_name #define stats_ptr b.ifr_ifru.ifru_data +#endif /* * Ioctl definitions. diff --git a/sysdeps/unix/sysv/linux/net/if_ppp.h b/sysdeps/unix/sysv/linux/net/if_ppp.h index 1b1c3ea..d95d247 100644 --- a/sysdeps/unix/sysv/linux/net/if_ppp.h +++ b/sysdeps/unix/sysv/linux/net/if_ppp.h @@ -119,6 +119,8 @@ struct ppp_option_data { int transmit; }; +/* 'struct ifreq' is only available from net/if.h under __USE_MISC. */ +#ifdef __USE_MISC struct ifpppstatsreq { struct ifreq b; struct ppp_stats stats; /* statistic information */ @@ -131,6 +133,7 @@ struct ifpppcstatsreq { #define ifr__name b.ifr_ifrn.ifrn_name #define stats_ptr b.ifr_ifru.ifru_data +#endif /* * Ioctl definitions.