Mesa (master): drm-shim: fix EOF case

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 13 14:27:23 UTC 2019


Module: Mesa
Branch: master
Commit: e101af8671a13a8eb8ce714e07294b73a99821cd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e101af8671a13a8eb8ce714e07294b73a99821cd

Author: Christian Gmeiner <christian.gmeiner at gmail.com>
Date:   Tue Nov 12 12:46:20 2019 +0100

drm-shim: fix EOF case

Close input end of the pipe after data was written. Without this
fix I have seen a hang in sysfs_uevent_get(.., "OF_FULLNAME")
when key was not found.

Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/drm-shim/drm_shim.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/drm-shim/drm_shim.c b/src/drm-shim/drm_shim.c
index 7c7d5f0f009..381a94fb9d1 100644
--- a/src/drm-shim/drm_shim.c
+++ b/src/drm-shim/drm_shim.c
@@ -219,6 +219,7 @@ PUBLIC FILE *fopen(const char *path, const char *mode)
          pipe(fds);
          write(fds[1], file_overrides[i].contents,
                strlen(file_overrides[i].contents));
+         close(fds[1]);
          return fdopen(fds[0], "r");
       }
    }




More information about the mesa-commit mailing list