loader: use loader_open_device() to handle O_CLOEXEC

Some platforms lack O_CLOEXEC. The loader_open_device() handles those
appropriately, so use the helper.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
This commit is contained in:
Emil Velikov 2019-02-19 15:30:39 +00:00 committed by Emil Velikov
parent f0a7b463b5
commit 02344fe80b

View file

@ -137,7 +137,7 @@ loader_open_render_node(const char *name)
(device->bustype == DRM_BUS_PLATFORM)) {
drmVersionPtr version;
fd = open(device->nodes[DRM_NODE_RENDER], O_RDWR | O_CLOEXEC);
fd = loader_open_device(device->nodes[DRM_NODE_RENDER]);
if (fd < 0)
continue;