Change wl_os_dupfd_cloexec minfd to be int
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Thu, 18 Mar 2021 10:46:55 +0000 (10:46 +0000)
committerSimon Ser <contact@emersion.fr>
Thu, 15 Apr 2021 07:34:53 +0000 (07:34 +0000)
The fcntl() argument is defined to be an int and not a long. This does not
matter on most architectures since the value is passed in registers, but
it causes issues on big-endian architectures that pass variadic arguments
on the stack.

Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Reviewed-by: Simon Ser <contact@emersion.fr>
src/wayland-os.c
src/wayland-os.h

index 93b6f5f..1e4a23d 100644 (file)
@@ -73,7 +73,7 @@ wl_os_socket_cloexec(int domain, int type, int protocol)
 }
 
 int
-wl_os_dupfd_cloexec(int fd, long minfd)
+wl_os_dupfd_cloexec(int fd, int minfd)
 {
        int newfd;
 
index f51efaa..af37640 100644 (file)
@@ -30,7 +30,7 @@ int
 wl_os_socket_cloexec(int domain, int type, int protocol);
 
 int
-wl_os_dupfd_cloexec(int fd, long minfd);
+wl_os_dupfd_cloexec(int fd, int minfd);
 
 ssize_t
 wl_os_recvmsg_cloexec(int sockfd, struct msghdr *msg, int flags);