aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drmtools.c4
-rw-r--r--fbcon.c2
-rw-r--r--fbtools.c2
-rw-r--r--kbd.c2
4 files changed, 5 insertions, 5 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;
diff --git a/fbcon.c b/fbcon.c
index 071fcbd..78c47c4 100644
--- a/fbcon.c
+++ b/fbcon.c
@@ -127,7 +127,7 @@ static int open_restricted(const char *path, int flags, void *user_data)
{
int fd;
- fd = open(path, flags);
+ fd = open(path, flags | O_CLOEXEC);
if (fd < 0) {
fprintf(stderr, "open %s: %s\n", path, strerror(errno));
return fd;
diff --git a/fbtools.c b/fbtools.c
index e7dc30a..7f993f7 100644
--- a/fbtools.c
+++ b/fbtools.c
@@ -235,7 +235,7 @@ gfxstate* fb_init(const char *device, char *mode)
fprintf(stderr, "trying fbdev: %s ...\n", device);
/* get current settings (which we have to restore) */
- if (-1 == (fb = open(device,O_RDWR /* O_WRONLY */))) {
+ if (-1 == (fb = open(device,O_RDWR | O_CLOEXEC))) {
fprintf(stderr,"open %s: %s\n",device,strerror(errno));
exit(1);
}
diff --git a/kbd.c b/kbd.c
index 4ed2540..1d74132 100644
--- a/kbd.c
+++ b/kbd.c
@@ -201,7 +201,7 @@ static int open_restricted(const char *path, int flags, void *user_data)
{
int fd;
- fd = open(path, flags);
+ fd = open(path, flags | O_CLOEXEC);
if (fd < 0) {
fprintf(stderr, "open %s: %s\n", path, strerror(errno));
return fd;