summaryrefslogtreecommitdiffstats
path: root/src/network/socket
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-08-10 08:25:28 -0700
committerThiago Macieira <thiago.macieira@intel.com>2017-08-10 22:51:56 +0000
commitfeb24153633859502f30bc16b149c78fb1d651b7 (patch)
tree7bcca7adf40ed72bb51cbc37cb16553944f60619 /src/network/socket
parentf4e0ffb11c158908cfc33df1e06fcd032501ef1c (diff)
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 <jake.petroules@qt.io>
Diffstat (limited to 'src/network/socket')
-rw-r--r--src/network/socket/qnet_unix_p.h2
1 files changed, 1 insertions, 1 deletions
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 <typename T>
-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);