diff options
Diffstat (limited to 'miext/sync/misyncshm.c')
-rw-r--r-- | miext/sync/misyncshm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/miext/sync/misyncshm.c b/miext/sync/misyncshm.c index 3f9350af5..20780fde8 100644 --- a/miext/sync/misyncshm.c +++ b/miext/sync/misyncshm.c @@ -32,6 +32,7 @@ #include "pixmapstr.h" #include <sys/mman.h> #include <unistd.h> +#include <fcntl.h> #include <X11/xshmfence.h> static DevPrivateKeyRec syncShmFencePrivateKey; @@ -126,6 +127,7 @@ miSyncShmCreateFenceFromFd(ScreenPtr pScreen, SyncFence *pFence, int fd, Bool in miSyncInitFence(pScreen, pFence, initially_triggered); + fd = os_move_fd(fd); pPriv->fence = xshmfence_map_shm(fd); if (pPriv->fence) { pPriv->fd = fd; @@ -145,6 +147,7 @@ miSyncShmGetFenceFd(ScreenPtr pScreen, SyncFence *pFence) pPriv->fd = xshmfence_alloc_shm(); if (pPriv->fd < 0) return -1; + pPriv->fd = os_move_fd(pPriv->fd); pPriv->fence = xshmfence_map_shm(pPriv->fd); if (!pPriv->fence) { close (pPriv->fd); |