aboutsummaryrefslogtreecommitdiffstats
path: root/drmtools.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-01-31 12:59:45 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-01-31 12:59:45 +0100
commit8c074984301b0e358d0698535d9f457b703db59d (patch)
tree81fb8713a6d0a0bfce22949aecbf7b08c7f579d9 /drmtools.c
parent920879c30814c1460ef6d0ea4004bcbfaf8efd9f (diff)
downloadfbida-8c074984301b0e358d0698535d9f457b703db59d.tar.gz
use cloexec
Diffstat (limited to 'drmtools.c')
-rw-r--r--drmtools.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drmtools.c b/drmtools.c
index f731a92..2ed8197 100644
--- a/drmtools.c
+++ b/drmtools.c
@@ -84,7 +84,7 @@ int drm_init_dev(const char *dev, const char *output, const char *mode)
int i, rc;
/* open device */
- drm_fd = open(dev, O_RDWR);
+ drm_fd = open(dev, O_RDWR | O_CLOEXEC);
if (drm_fd < 0) {
fprintf(stderr, "drm: open %s: %s\n", dev, strerror(errno));
return -1;
@@ -298,7 +298,7 @@ void drm_info(const char *device)
} else {
snprintf(dev, sizeof(dev), DRM_DEV_NAME, DRM_DIR_NAME, 0);
}
- drm_fd = open(dev, O_RDWR);
+ drm_fd = open(dev, O_RDWR | O_CLOEXEC);
if (drm_fd < 0) {
fprintf(stderr, "drm: open %s: %s\n", dev, strerror(errno));
return;