diff options
Diffstat (limited to 'lib/mesa/src/gallium/winsys/svga/drm/vmw_screen.c')
-rw-r--r-- | lib/mesa/src/gallium/winsys/svga/drm/vmw_screen.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/mesa/src/gallium/winsys/svga/drm/vmw_screen.c b/lib/mesa/src/gallium/winsys/svga/drm/vmw_screen.c index 7fcb6d277..d0bfcd728 100644 --- a/lib/mesa/src/gallium/winsys/svga/drm/vmw_screen.c +++ b/lib/mesa/src/gallium/winsys/svga/drm/vmw_screen.c @@ -31,9 +31,15 @@ #include "util/u_memory.h" #include "pipe/p_compiler.h" #include "util/u_hash_table.h" -#include <sys/types.h> +#ifdef MAJOR_IN_MKDEV +#include <sys/mkdev.h> +#endif +#ifdef MAJOR_IN_SYSMACROS +#include <sys/sysmacros.h> +#endif #include <sys/stat.h> #include <unistd.h> +#include <fcntl.h> static struct util_hash_table *dev_hash = NULL; @@ -83,7 +89,7 @@ vmw_winsys_create( int fd ) vws->device = stat_buf.st_rdev; vws->open_count = 1; - vws->ioctl.drm_fd = dup(fd); + vws->ioctl.drm_fd = fcntl(fd, F_DUPFD_CLOEXEC, 3); vws->base.have_gb_dma = TRUE; vws->base.need_to_rebind_resources = FALSE; |