diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-08-10 08:25:28 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-08-14 18:02:17 +0000 |
commit | 116e79c0788674380eab8bca84b22200d7b7e22a (patch) | |
tree | 57c452f7ea0e82c2a66f02949feab9b9e33790e0 /src | |
parent | 3e379bcc799edb6a78bc8cea093a278dbe32f33c (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>
(cherry picked from commit feb24153633859502f30bc16b149c78fb1d651b7)
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/network/socket/qnet_unix_p.h | 2 |
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 1481f565d4..946b7b48ad 100644 --- a/src/network/socket/qnet_unix_p.h +++ b/src/network/socket/qnet_unix_p.h @@ -158,7 +158,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); |