From patchwork Sun Apr 24 07:57:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Frost X-Patchwork-Id: 8924101 Return-Path: X-Original-To: patchwork-dri-devel@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 C53B69F441 for ; Mon, 25 Apr 2016 08:12:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0E03320173 for ; Mon, 25 Apr 2016 08:12:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0A37D20166 for ; Mon, 25 Apr 2016 08:12:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F417A6E4EC; Mon, 25 Apr 2016 08:12:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 516 seconds by postgrey-1.35 at gabe; Sun, 24 Apr 2016 08:09:04 UTC Received: from sv13.net-housting.de (sv13.net-housting.de [178.248.244.23]) by gabe.freedesktop.org (Postfix) with ESMTPS id AEBD96E16C for ; Sun, 24 Apr 2016 08:09:04 +0000 (UTC) Received: from edoras (p54BB75FA.dip0.t-ipconnect.de [84.187.117.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv13.net-housting.de (Postfix) with ESMTPSA id 64BA4280F6797; Sun, 24 Apr 2016 10:00:22 +0200 (CEST) Received: from tobi by edoras with local (Exim 4.86) (envelope-from ) id 1auExp-00043h-TM; Sun, 24 Apr 2016 10:00:21 +0200 From: Tobias Frost To: Emil Velikov , ML dri-devel , Gary Wong Subject: [PATCH] Workaround for systems that does not have PATH_MAX, like hurd. Date: Sun, 24 Apr 2016 09:57:01 +0200 Message-Id: <1461484621-15446-1-git-send-email-tobi@coldtobi.de> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1461216633.14744.4.camel@frost.de> References: <1461216633.14744.4.camel@frost.de> X-Mailman-Approved-At: Mon, 25 Apr 2016 08:10:38 +0000 Cc: Tobias Frost X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 It is safe to define it here, as the code is only using it for string manipulation and not for syscalls that might make different assumptions. --- xf86drm.c | 7 +++++++ xf86drm.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/xf86drm.c b/xf86drm.c index 45aa5fc..4dac7a4 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -103,6 +103,13 @@ #define memclear(s) memset(&s, 0, sizeof(s)) +/* for systems like hurd, which does not have PATH_MAX. + Usage is only for string manipulation, so it is save to define it. + 1kB will be plenty space.*/ +#ifndef PATH_MAX +#define PATH_MAX (1024) +#endif + static drmServerInfoPtr drm_server_info; void drmSetServerInfo(drmServerInfoPtr info) diff --git a/xf86drm.h b/xf86drm.h index 481d882..1d45f02 100644 --- a/xf86drm.h +++ b/xf86drm.h @@ -58,7 +58,11 @@ extern "C" { #else /* One of the *BSDs */ +#if defined(__GNU__) +#include +#else #include +#endif #define DRM_IOCTL_NR(n) ((n) & 0xff) #define DRM_IOC_VOID IOC_VOID #define DRM_IOC_READ IOC_OUT