summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/fb/fb_egl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/fb/fb_egl.c b/src/mesa/drivers/dri/fb/fb_egl.c
index e139e91552..78ca3a5860 100644
--- a/src/mesa/drivers/dri/fb/fb_egl.c
+++ b/src/mesa/drivers/dri/fb/fb_egl.c
@@ -744,12 +744,19 @@ fbShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
snprintf(buffer, sizeof(buffer), "%s/%s/mode", sysfs, scrn->fb);
file = fopen(buffer, "r+");
+ if (!file) {
+err:
+ printf("chown all fb sysfs attrib to allow write - %s\n", buffer);
+ return EGL_FALSE;
+ }
fputs(mode->Name, file);
fclose(file);
snprintf(buffer, sizeof(buffer), "%s/%s/bits_per_pixel", sysfs, scrn->fb);
file = fopen(buffer, "r+");
+ if (!file)
+ goto err;
snprintf(buffer, sizeof(buffer), "%d", surf->Base.Config->glmode.rgbBits);
fputs(buffer, file);
fclose(file);