From patchwork Mon Mar 19 13:47:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 132039 Delivered-To: patches@linaro.org Received: by 10.46.84.17 with SMTP id i17csp2752999ljb; Mon, 19 Mar 2018 06:47:37 -0700 (PDT) X-Received: by 10.101.97.139 with SMTP id c11mr9173980pgv.435.1521467257280; Mon, 19 Mar 2018 06:47:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521467257; cv=none; d=google.com; s=arc-20160816; b=IqsUe3QqVMCYsV4x6lnOo85JQop/3auSibkEKc42evkaRH4mW/6d1jAsaxjaV1AcF6 mMPNzMemZiyBV5FVZMwRrKfGHB6H/XyoGH3RoL3Vyi01lHlgZ09FdIjSnVPusTBUzhMn Iu/kHP4pZCHPK4CHtP5Ee8oBNAqyNdhVtSduKIi1l2KSWhkoUu349gmS2fno3ZQ27YH+ odq9P0WOVW0/q2kD+T/GkQCbT0+JX0n1upmICdTrhG504/ya7ZigQX3XXf6bYB8tJUw9 g1AJdtZZ34JFQjyMkmfHiKiVLlY7+dLoFL++1Sb5Y44kpVhgp/XhB3ym7zOwDMfXwmiH RXbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=RgLwZ+BQd9sYxc6kNXHSqeMdlDgy/axW53j1GMcnk64=; b=UvLQuMip60TFpveUGbCG1ky7o6oyyQTmol3PBfW3hUS3WVYm/Tvl8SiZKcTysOiabH KlyPuwy43VY1vrg0NNobZ+CSLzVZ0GqPCNlu7sIuASl5nmX5c3yHDFfg+m2BAuLEtdv1 QlCDqxDfde37xc6kJnAgtNDLo+hY4cgXMTM3/TVB3ww7hHmiyq02lJ3+d3neL8AmZWBo QYvUYoqj6pHCmBuQlLTpJepHmtuavpgXWA+zloeDfcWq/dYpONdKL01humAhfqKcHv71 cfMtoNgGOfCkIACpK/DcvJUUWY8X4azHsTAC1eff3d7rQUMtSn68Y0PWRQ2ERXmupMuV kLZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dO4YbijU; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id b2sor10339pgq.395.2018.03.19.06.47.37 for (Google Transport Security); Mon, 19 Mar 2018 06:47:37 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dO4YbijU; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=RgLwZ+BQd9sYxc6kNXHSqeMdlDgy/axW53j1GMcnk64=; b=dO4YbijUv8jU3e+eeJEm4taZZzSGCnPIgkTUsLTWYvDHPIhnYeh4KuIq6YW/RCzcd5 O0kroMSUZTaoJdaO2iIeDLfhd9OFTDQbj2UaFHxej8+viilsXdxJruWxPLVQeAT3Y6X0 Pxtpq44oYeer6jNDMl91aEszepzJrq5T2CDiY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RgLwZ+BQd9sYxc6kNXHSqeMdlDgy/axW53j1GMcnk64=; b=DMrsrUueI3DXLmrxZn16JHEvHMTyaAuKfYH2zkIiCkvPeDQ1r/30eVgRBr9Lgt58ig WYZBiX1MYzii8ycq7HlUSBZ3Ox1KFAp1MAo1fxI9PXeGXBTswq1wP3BEFByf5iBnEa2u IXQRkwkT52wEqF7PpZVJHVSgQzAkhTUb8FrhUYCYp0WX8W6nID+7S4v7jH6Gjqdtuyqe DJ07QV2feS9DufgJ1X6V6wo2Ir2qOfC3f3l5wDi0NICwQHNmPA7lfru6lpFCAaSFG4W5 5s5YEjlTeqTr6qhuuMHMXtoCfloXnqcGQhDJxv+4+mjJeJLNaIkdq6XMv9+8IXwLVzS7 HuIA== X-Gm-Message-State: AElRT7FUNGRQyCZsGXSogliwrHH3ziVSRiBb01ovcp6+1g9Dozpsf55d NLpF7m4LEZYcaDatMjYgK3goiqig X-Google-Smtp-Source: AG47ELuAKCAsoMkOFq/7C0Q3xKnAm2Q2/5muaL9MmEH0CUNoGw4i06Te5sfn1h2CKYmgYY1nn9EQfQ== X-Received: by 10.101.96.10 with SMTP id m10mr968891pgu.438.1521467256685; Mon, 19 Mar 2018 06:47:36 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:600:5100:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id j19sm161863pfh.26.2018.03.19.06.47.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Mar 2018 06:47:35 -0700 (PDT) From: John Stultz To: dri-devel Cc: John Stultz , Robert Foss , Rob Herring , Stefan Schake Subject: [PATCH] libdrm: Use readdir instead of readdir_r to avoid build warnings Date: Mon, 19 Mar 2018 06:47:32 -0700 Message-Id: <1521467252-20065-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 Building libdrm under AOSP, we see the following build warning: external/libdrm/xf86drm.c:2861:12: warning: 'readdir_r' is deprecated: readdir_r is deprecated; use readdir instead [-Wdeprecated-declarations] while (readdir_r(sysdir, pent, &ent) == 0 && ent != NULL) { ^ Thus, this patch replaces readdir_r with readdir. Cc: Robert Foss Cc: Rob Herring Cc: Stefan Schake Signed-off-by: John Stultz --- xf86drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 Reviewed-by: Emil Velikov diff --git a/xf86drm.c b/xf86drm.c index 344326d..b9058c2 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -2858,7 +2858,7 @@ static char *drmGetMinorNameForFD(int fd, int type) if (pent == NULL) goto out_close_dir; - while (readdir_r(sysdir, pent, &ent) == 0 && ent != NULL) { + while ((ent = readdir(sysdir))) { if (strncmp(ent->d_name, name, len) == 0) { snprintf(dev_name, sizeof(dev_name), DRM_DIR_NAME "/%s", ent->d_name);