From feb24153633859502f30bc16b149c78fb1d651b7 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 10 Aug 2017 08:25:28 -0700 Subject: Fix write and read-write ioctls on certain 64-bit OS Using int as the operation parameter was wrong. It meant any write or RW ioctls (which have the MSB set) would be sign-extended to 64-bit when calling the native API. Depending on the OS, the upper 32 bits were not cleared prior to comparing with the call number, resulting in unexpected errors. Linux and FreeBSD operated properly; I only got the error on Darwin. Change-Id: Iaf4157b7efa2416d898cfffd14d985af65c1ff89 Reviewed-by: Jake Petroules --- src/network/socket/qnet_unix_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/network/socket') diff --git a/src/network/socket/qnet_unix_p.h b/src/network/socket/qnet_unix_p.h index 46fbc9757a..73d7ec2e77 100644 --- a/src/network/socket/qnet_unix_p.h +++ b/src/network/socket/qnet_unix_p.h @@ -165,7 +165,7 @@ static inline int qt_safe_connect(int sockfd, const struct sockaddr *addr, QT_SO // VxWorks' headers specify 'int' instead of '...' for the 3rd ioctl() parameter. template -static inline int qt_safe_ioctl(int sockfd, int request, T arg) +static inline int qt_safe_ioctl(int sockfd, unsigned long request, T arg) { #ifdef Q_OS_VXWORKS return ::ioctl(sockfd, request, (int) arg); -- cgit v1.2.3