From patchwork Wed May 18 01:55:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gerrit-no-reply@lists.osmocom.org X-Patchwork-Id: 623356 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by ozlabs.org (Postfix) with ESMTP id 3r8cjT64V3z9sdQ for ; Wed, 18 May 2016 11:55:41 +1000 (AEST) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id 83C59602F; Wed, 18 May 2016 01:55:38 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received: from 127.0.1.12 (unknown [127.0.1.12]) by lists.osmocom.org (Postfix) with ESMTPA id 452046029; Wed, 18 May 2016 01:55:37 +0000 (UTC) Date: Wed, 18 May 2016 01:55:37 +0000 From: Arran Cudbard-bell Message-ID: X-Gerrit-MessageType: newchange Subject: Change in libosmocore[master]: Ignore config.cache X-Gerrit-Change-Id: I580a500edcf4812e570be586890abef746083a8c X-Gerrit-ChangeURL: X-Gerrit-Commit: 1cb7856b7c426b9a25e6f01052305e695914407b MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/2.12.2-31-gb331dbd-dirty X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Development of OpenBSC, OsmoBSC, OsmoNITB, OsmoCSCN" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: a.cudbardb@freeradius.org Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" Arran Cudbard-bell has uploaded a new change for review. https://gerrit.osmocom.org/74 Change subject: Ignore config.cache ...................................................................... Ignore config.cache Change-Id: I580a500edcf4812e570be586890abef746083a8c --- M .gitignore M include/osmocom/core/endian.h M src/stats.c 3 files changed, 25 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/74/1 diff --git a/.gitignore b/.gitignore index 32915aa..03ce379 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ aminclude.am m4/*.m4 autom4te.cache +config.cache config.h* config.sub config.log diff --git a/include/osmocom/core/endian.h b/include/osmocom/core/endian.h index c890fd7..4616a65 100644 --- a/include/osmocom/core/endian.h +++ b/include/osmocom/core/endian.h @@ -23,6 +23,17 @@ #else #error "Unknown endian" #endif +#elif defined(__APPLE__) +#include + #if defined(__DARWIN_LITTLE_ENDIAN) + #define OSMO_IS_LITTLE_ENDIAN 1 + #define OSMO_IS_BIG_ENDIAN 0 + #elif define(__DARWIN_BIG_ENDIAN) + #define OSMO_IS_LITTLE_ENDIAN 1 + #define OSMO_IS_BIG_ENDIAN 0 + #else + #error "Unknown endian" + #endif #else #include #if __BYTE_ORDER == __LITTLE_ENDIAN diff --git a/src/stats.c b/src/stats.c index 73b2703..5f1d028 100644 --- a/src/stats.c +++ b/src/stats.c @@ -301,6 +301,14 @@ if (sock == -1) return -errno; +#if defined(__APPLE__) && !defined(MSG_NOSIGNAL) + { + static int val = 1; + + rc = setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, (void*)&val, sizeof(val)); + goto failed; + } +#endif if (srep->bind_addr_len > 0) { rc = bind(sock, &srep->bind_addr, srep->bind_addr_len); if (rc == -1) @@ -345,7 +353,11 @@ { int rc; - rc = sendto(srep->fd, data, data_len, MSG_NOSIGNAL | MSG_DONTWAIT, + rc = sendto(srep->fd, data, data_len, +#ifdef MSG_NOSIGNAL + MSG_NOSIGNAL | +#endif + MSG_DONTWAIT, &srep->dest_addr, srep->dest_addr_len); if (rc == -1)