From patchwork Thu Apr 14 04:02:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 8831201 Return-Path: X-Original-To: patchwork-linux-nfs@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 7DE9F9F3A0 for ; Thu, 14 Apr 2016 04:02:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 911D920256 for ; Thu, 14 Apr 2016 04:02:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 64E64200E1 for ; Thu, 14 Apr 2016 04:02:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751275AbcDNECn (ORCPT ); Thu, 14 Apr 2016 00:02:43 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:53058 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751072AbcDNECm (ORCPT ); Thu, 14 Apr 2016 00:02:42 -0400 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 8FAA2340DC2 for ; Thu, 14 Apr 2016 04:02:31 +0000 (UTC) From: Mike Frysinger To: linux-nfs@vger.kernel.org Subject: [PATCH nfs-utils] fix building w/newer C libraries Date: Thu, 14 Apr 2016 00:02:27 -0400 Message-Id: <1460606547-3957-1-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 2.7.4 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Linux C libraries are moving away from implicitly including the header sys/sysmacros.h via sys/types.h. We would like to do this for glibc now, but others (musl/etc...) have been doing it already. This means any code using major/minor/makedevs functions will fail to build when they don't include that header. Leverage the AC_HEADER_MAJOR macro that configure is already using to pull in the right header. Signed-off-by: Mike Frysinger --- support/include/xcommon.h | 6 ++++++ support/nfs/nfsexport.c | 1 + utils/blkmapd/device-discovery.c | 1 + utils/mountd/cache.c | 1 + 4 files changed, 9 insertions(+) diff --git a/support/include/xcommon.h b/support/include/xcommon.h index d1a4b18..23c9a13 100644 --- a/support/include/xcommon.h +++ b/support/include/xcommon.h @@ -17,6 +17,12 @@ #include #include +#ifdef MAJOR_IN_MKDEV +#include +#elif defined(MAJOR_IN_SYSMACROS) +#include +#endif + #define streq(s, t) (strcmp ((s), (t)) == 0) /* Functions in sundries.c that are used in mount.c and umount.c */ diff --git a/support/nfs/nfsexport.c b/support/nfs/nfsexport.c index afd7c90..4b13265 100644 --- a/support/nfs/nfsexport.c +++ b/support/nfs/nfsexport.c @@ -19,6 +19,7 @@ #include "nfslib.h" #include "misc.h" +#include "xcommon.h" /* if /proc/net/rpc/... exists, then * write to it, as that interface is more stable. diff --git a/utils/blkmapd/device-discovery.c b/utils/blkmapd/device-discovery.c index b010628..052d582 100644 --- a/utils/blkmapd/device-discovery.c +++ b/utils/blkmapd/device-discovery.c @@ -51,6 +51,7 @@ #include #include "device-discovery.h" +#include "xcommon.h" #define EVENT_SIZE (sizeof(struct inotify_event)) #define EVENT_BUFSIZE (1024 * EVENT_SIZE) diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c index 7847446..ec86a22 100644 --- a/utils/mountd/cache.c +++ b/utils/mountd/cache.c @@ -31,6 +31,7 @@ #include "mountd.h" #include "fsloc.h" #include "pseudoflavors.h" +#include "xcommon.h" #ifdef USE_BLKID #include "blkid/blkid.h"