From: John Stultz <john.stultz@linaro.org>
To: dri-devel <dri-devel@lists.freedesktop.org>
Cc: Robert Foss <robert.foss@collabora.com>,
Stefan Schake <stschake@gmail.com>
Subject: [PATCH] libdrm: Use readdir instead of readdir_r to avoid build warnings
Date: Mon, 19 Mar 2018 06:47:32 -0700 [thread overview]
Message-ID: <1521467252-20065-1-git-send-email-john.stultz@linaro.org> (raw)
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 <robert.foss@collabora.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Stefan Schake <stschake@gmail.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
xf86drm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
--
2.7.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2018-03-19 13:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-19 13:47 John Stultz [this message]
2018-03-19 14:11 ` [PATCH] libdrm: Use readdir instead of readdir_r to avoid build warnings Emil Velikov
2018-03-19 14:41 ` Eric Engestrom
2018-03-20 17:54 ` Emil Velikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1521467252-20065-1-git-send-email-john.stultz@linaro.org \
--to=john.stultz@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=robert.foss@collabora.com \
--cc=stschake@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.