From patchwork Tue May 3 15:58:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Smalley X-Patchwork-Id: 9005681 Return-Path: X-Original-To: patchwork-selinux@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2C00B9F1D3 for ; Tue, 3 May 2016 15:58:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 168E4202D1 for ; Tue, 3 May 2016 15:58:47 +0000 (UTC) Received: from emsm-gh1-uea11.nsa.gov (emsm-gh1-uea11.nsa.gov [8.44.101.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B86CC2021F for ; Tue, 3 May 2016 15:58:45 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.24,573,1454976000"; d="scan'208";a="15834891" IronPort-PHdr: =?us-ascii?q?9a23=3AyzB5dROEMbJTs3+XaKQl6mtUPXoX/o7sNwtQ0KIM?= =?us-ascii?q?zox0KPn+rarrMEGX3/hxlliBBdydsKIVzbKO+P+6EUU7or+/81k6OKRWUBEEjc?= =?us-ascii?q?hE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZv?= =?us-ascii?q?IaytQ8iJ35Xxj7j5pMebSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf?= =?us-ascii?q?9d32JiKAHbtR/94sCt4MwrqHwI6Loc7coIbYHWN+R9FOQZX3waNDUu6cnqswTT?= =?us-ascii?q?ZRee7XsbFGMNm1xHBBaWwgv9W8LKribitud7kBKfNMnyQKF8DS+u9I93WRToj2?= =?us-ascii?q?EBLDd//2bJ3J8jxJlHqQ6s8kQsi7XfZ5uYYb8nJq4=3D?= X-IPAS-Result: =?us-ascii?q?A2FuBQCsyShX/wHyM5BfHAGDG1NuD7wNHwuHLUwBAQEBAQE?= =?us-ascii?q?CAmIngi0KOBABAQEBAQEBAQEjAQEBAQEBIwINZgIkExQgCwMDCQIXKQgIAwEtF?= =?us-ascii?q?R8LBRgEiAkOvFwBHY5+EQGFdQWYFoV8iBwCgjSHHIU+AkWGfYdwYoIFG4FnUIc?= =?us-ascii?q?HgTUBAQE?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 May 2016 15:58:43 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u43FvImE001731; Tue, 3 May 2016 11:57:33 -0400 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id u43FvFA5280701 for ; Tue, 3 May 2016 11:57:15 -0400 Received: from moss-pluto.infosec.tycho.ncsc.mil (moss-pluto [192.168.25.131]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u43FvFu2001724; Tue, 3 May 2016 11:57:15 -0400 From: Stephen Smalley To: selinux@tycho.nsa.gov Subject: [PATCH] libsepol, checkpolicy, secilc: Replace #ifdef DARWIN with __APPLE__. Date: Tue, 3 May 2016 11:58:45 -0400 Message-Id: <1462291125-28934-1-git-send-email-sds@tycho.nsa.gov> X-Mailer: git-send-email 2.5.5 X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: Cc: enh@google.com, Stephen Smalley MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As per discussion in https://android-review.googlesource.com/#/c/221980, we should be using #ifdef __APPLE__ rather than our own custom-defined DARWIN for building on MacOS X. Signed-off-by: Stephen Smalley Acked-By: Nick Kralevich --- checkpolicy/Android.mk | 4 ---- checkpolicy/checkpolicy.c | 2 +- checkpolicy/policy_define.c | 2 +- libsepol/Android.mk | 4 ---- libsepol/src/genbools.c | 4 ++-- libsepol/src/genusers.c | 4 ++-- libsepol/src/node_record.c | 4 ++-- libsepol/src/private.h | 4 ++-- secilc/Android.mk | 4 ---- 9 files changed, 10 insertions(+), 22 deletions(-) diff --git a/checkpolicy/Android.mk b/checkpolicy/Android.mk index 98f5168..3b7ff8a 100644 --- a/checkpolicy/Android.mk +++ b/checkpolicy/Android.mk @@ -12,10 +12,6 @@ common_cflags := \ -Wall -Wshadow -O2 \ -pipe -fno-strict-aliasing \ -ifeq ($(HOST_OS),darwin) -common_cflags += -DDARWIN -endif - common_includes := \ $(LOCAL_PATH)/ \ $(LOCAL_PATH)/../libsepol/include/ \ diff --git a/checkpolicy/checkpolicy.c b/checkpolicy/checkpolicy.c index 7947c20..2d68316 100644 --- a/checkpolicy/checkpolicy.c +++ b/checkpolicy/checkpolicy.c @@ -73,7 +73,7 @@ #include #include -#ifdef DARWIN +#ifdef __APPLE__ #include #endif diff --git a/checkpolicy/policy_define.c b/checkpolicy/policy_define.c index 2068b71..100e517 100644 --- a/checkpolicy/policy_define.c +++ b/checkpolicy/policy_define.c @@ -5140,7 +5140,7 @@ int define_ipv6_node_context(void) memset(newc, 0, sizeof(ocontext_t)); -#ifdef DARWIN +#ifdef __APPLE__ memcpy(&newc->u.node6.addr[0], &addr.s6_addr[0], 16); memcpy(&newc->u.node6.mask[0], &mask.s6_addr[0], 16); #else diff --git a/libsepol/Android.mk b/libsepol/Android.mk index 5d2c96b..6d89f17 100644 --- a/libsepol/Android.mk +++ b/libsepol/Android.mk @@ -69,10 +69,6 @@ common_cflags := \ -Wshadow -Wmissing-noreturn \ -Wmissing-format-attribute -ifeq ($(HOST_OS), darwin) -common_cflags += -DDARWIN -endif - common_includes := \ $(LOCAL_PATH)/include/ \ $(LOCAL_PATH)/src/ \ diff --git a/libsepol/src/genbools.c b/libsepol/src/genbools.c index 6a06ec9..c81e848 100644 --- a/libsepol/src/genbools.c +++ b/libsepol/src/genbools.c @@ -79,7 +79,7 @@ static int load_booleans(struct policydb *policydb, const char *path, if (boolf == NULL) goto localbool; -#ifdef DARWIN +#ifdef __APPLE__ if ((buffer = (char *)malloc(255 * sizeof(char))) == NULL) { ERR(NULL, "out of memory"); return -1; @@ -111,7 +111,7 @@ static int load_booleans(struct policydb *policydb, const char *path, boolf = fopen(localbools, "r"); if (boolf != NULL) { -#ifdef DARWIN +#ifdef __APPLE__ while(fgets(buffer, 255, boolf) != NULL) { #else diff --git a/libsepol/src/genusers.c b/libsepol/src/genusers.c index 7826b71..0b98a76 100644 --- a/libsepol/src/genusers.c +++ b/libsepol/src/genusers.c @@ -7,7 +7,7 @@ #include -#ifndef DARWIN +#ifndef __APPLE__ #include #endif @@ -47,7 +47,7 @@ static int load_users(struct policydb *policydb, const char *path) if (fp == NULL) return -1; -#ifdef DARWIN +#ifdef __APPLE__ if ((buffer = (char *)malloc(255 * sizeof(char))) == NULL) { ERR(NULL, "out of memory"); return -1; diff --git a/libsepol/src/node_record.c b/libsepol/src/node_record.c index bd48ba0..21043b6 100644 --- a/libsepol/src/node_record.c +++ b/libsepol/src/node_record.c @@ -70,7 +70,7 @@ static int node_parse_addr(sepol_handle_t * handle, return STATUS_ERR; } -#ifdef DARWIN +#ifdef __APPLE__ memcpy(addr_bytes, in_addr.s6_addr, 16); #else memcpy(addr_bytes, in_addr.s6_addr32, 16); @@ -162,7 +162,7 @@ static int node_expand_addr(sepol_handle_t * handle, { struct in6_addr addr; memset(&addr, 0, sizeof(struct in6_addr)); -#ifdef DARWIN +#ifdef __APPLE__ memcpy(&addr.s6_addr[0], addr_bytes, 16); #else memcpy(&addr.s6_addr32[0], addr_bytes, 16); diff --git a/libsepol/src/private.h b/libsepol/src/private.h index 8a6d4bb..9c700c9 100644 --- a/libsepol/src/private.h +++ b/libsepol/src/private.h @@ -5,7 +5,7 @@ #include -#ifdef DARWIN +#ifdef __APPLE__ #include #include #else @@ -16,7 +16,7 @@ #include #include -#ifdef DARWIN +#ifdef __APPLE__ #define __BYTE_ORDER BYTE_ORDER #define __LITTLE_ENDIAN LITTLE_ENDIAN #endif diff --git a/secilc/Android.mk b/secilc/Android.mk index 3dd9023..6c7b9d3 100644 --- a/secilc/Android.mk +++ b/secilc/Android.mk @@ -6,10 +6,6 @@ common_cflags := \ -Wall -Wshadow -O2 \ -pipe -fno-strict-aliasing \ -ifeq ($(HOST_OS), darwin) -common_cflags += -DDARWIN -endif - common_includes := \ $(LOCAL_PATH)/../libsepol/cil/include/ \ $(LOCAL_PATH)/../libsepol/include/ \