From 3183149c8c791ca519432ff935d5e42d84404f3d Mon Sep 17 00:00:00 2001 From: Tobias Jakobi Date: Sat, 7 Mar 2015 14:58:30 +0100 Subject: [PATCH] exynos_gfx: fix error handling of fd open Opening an fd can fail for multiple reasons, we would just error out on EPERM. Handle the other cases as well. --- gfx/drivers/exynos_gfx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gfx/drivers/exynos_gfx.c b/gfx/drivers/exynos_gfx.c index 51f4a05b75..bb88fda056 100644 --- a/gfx/drivers/exynos_gfx.c +++ b/gfx/drivers/exynos_gfx.c @@ -181,7 +181,7 @@ static int get_device_index(void) snprintf(buf, sizeof(buf), "/dev/dri/card%d", index); fd = open(buf, O_RDWR); - if (fd == -1) break; + if (fd < 0) break; ver = drmGetVersion(fd); @@ -599,7 +599,7 @@ static int exynos_open(struct exynos_data *pdata) } fd = open(buf, O_RDWR); - if (fd == -1) + if (fd < 0) { RARCH_ERR("video_exynos: can't open drm device\n"); return -1;