tools/interactive-wayland.c
static int
os_fd_set_cloexec(int fd)
{
    long flags;

    if (fd == -1)
        return -1;

    flags = fcntl(fd, F_GETFD);
    if (flags == -1)
        return -1;

    if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1)
        return -1;

    return 0;
}
/* The following utility functions are taken from Weston's
 * shared/os-compatibility.c. */
The following utility functions are taken from Weston's
shared/os-compatibility.c.
The following utility functions are taken from Weston ' s shared / os - compatibility . c .
static int
os_fd_set_cloexec(int fd)
{
    long flags;
    if (fd == -1)
        return -1;
    flags = fcntl(fd, F_GETFD);
    if (flags == -1)
        return -1;
    if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1)
        return -1;
    return 0;
}
static int os_fd_set_cloexec ( int fd ) { long flags ; if ( fd == -1 ) return -1 ; flags = fcntl ( fd , F_GETFD ) ; if ( flags == -1 ) return -1 ; if ( fcntl ( fd , F_SETFD , flags | FD_CLOEXEC ) == -1 ) return -1 ; return 0 ; }
The following utility functions are taken from Weston's
 shared/os-compatibility.c.
The following utility functions are taken from Weston ' s shared / os - compatibility . c .