From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNHJO-0006w6-9w for qemu-devel@nongnu.org; Mon, 28 May 2018 08:31:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNHJL-0008LV-6C for qemu-devel@nongnu.org; Mon, 28 May 2018 08:31:42 -0400 Received: from 20.mo1.mail-out.ovh.net ([188.165.45.168]:35404) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fNHJK-0008KW-Ut for qemu-devel@nongnu.org; Mon, 28 May 2018 08:31:39 -0400 Received: from player763.ha.ovh.net (unknown [10.109.105.80]) by mo1.mail-out.ovh.net (Postfix) with ESMTP id C7837FF17B for ; Mon, 28 May 2018 14:31:36 +0200 (CEST) Date: Mon, 28 May 2018 14:31:32 +0200 From: Greg Kurz Message-ID: <20180528143132.6733e0db@bahia.lan> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 01/13] 9p: linux: Fix a couple Linux assumptions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: keno@juliacomputing.com Cc: qemu-devel@nongnu.org, Keno Fischer On Sat, 26 May 2018 01:23:03 -0400 keno@juliacomputing.com wrote: > From: Keno Fischer > > - Guard two Linux only headers. > - Define `ENOATTR` only if not only defined > (it's defined in system headers on Darwin). > > Signed-off-by: Keno Fischer > --- > fsdev/file-op-9p.h | 2 ++ > hw/9pfs/9p-local.c | 2 ++ > include/qemu/xattr.h | 4 +++- Irrespectively of the discussion on checking this in configure, there's another user of in fsdev/virtfs-proxy-helper.c. I see in patch 13 that the helper won't be built on Darwin, but this could change, and anyway, I'd like the handling of to stay consistent across the VirtFS code. > 3 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h > index 3fa062b..a13e729 100644 > --- a/fsdev/file-op-9p.h > +++ b/fsdev/file-op-9p.h > @@ -16,7 +16,9 @@ > > #include > #include > +#ifdef CONFIG_LINUX > #include > +#endif > #include "qemu-fsdev-throttle.h" > > #define SM_LOCAL_MODE_BITS 0600 > diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c > index b37b1db..f6c7526 100644 > --- a/hw/9pfs/9p-local.c > +++ b/hw/9pfs/9p-local.c > @@ -27,10 +27,12 @@ > #include "qemu/error-report.h" > #include "qemu/option.h" > #include > +#ifdef CONFIG_LINUX > #include > #ifdef CONFIG_LINUX_MAGIC_H > #include > #endif > +#endif > #include > > #ifndef XFS_SUPER_MAGIC > diff --git a/include/qemu/xattr.h b/include/qemu/xattr.h > index a83fe8e..f1d0f7b 100644 > --- a/include/qemu/xattr.h > +++ b/include/qemu/xattr.h > @@ -22,7 +22,9 @@ > #ifdef CONFIG_LIBATTR > # include > #else > -# define ENOATTR ENODATA > +# if !defined(ENOATTR) > +# define ENOATTR ENODATA > +# endif > # include > #endif >