diff options
author | Peter Hartmann <peter.hartmann@trolltech.com> | 2009-04-16 13:14:09 (GMT) |
---|---|---|
committer | Peter Hartmann <peter.hartmann@trolltech.com> | 2009-04-16 14:12:38 (GMT) |
commit | b43b57b251505157f32463094a9ac7c41ab69859 (patch) | |
tree | c258c768964902c64516dd3b12588cb909acb7dc /src/corelib | |
parent | 5c359a9b599e2024d070534c10c5a0e224eca5d8 (diff) | |
download | Qt-b43b57b251505157f32463094a9ac7c41ab69859.zip Qt-b43b57b251505157f32463094a9ac7c41ab69859.tar.gz Qt-b43b57b251505157f32463094a9ac7c41ab69859.tar.bz2 |
fix reading problem on 64-bit machines in QProcess and socket engine
QProcessPrivate and QNativeSocketEnginePrivate were reporting a wrong
number of bytes available on 64-bit machines, due to use of size_t in
ioctl. That was required by Irix, which we dropped support for, so we
can also drop size_t
Reviewed-by: Thiago
Task-number: 249537
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_inotify.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qprocess_unix.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp index 4445e3c..fa44531 100644 --- a/src/corelib/io/qfilesystemwatcher_inotify.cpp +++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp @@ -316,7 +316,7 @@ void QInotifyFileSystemWatcherEngine::readFromInotify() // qDebug() << "QInotifyFileSystemWatcherEngine::readFromInotify"; int buffSize = 0; - ioctl(inotifyFd, FIONREAD, &buffSize); + ioctl(inotifyFd, FIONREAD, (char *) &buffSize); QVarLengthArray<char, 4096> buffer(buffSize); buffSize = read(inotifyFd, buffer.data(), buffSize); const char *at = buffer.data(); diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 37173c8..33d4a47 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -850,10 +850,10 @@ bool QProcessPrivate::processStarted() qint64 QProcessPrivate::bytesAvailableFromStdout() const { - size_t nbytes = 0; + int nbytes = 0; qint64 available = 0; if (::ioctl(stdoutChannel.pipe[0], FIONREAD, (char *) &nbytes) >= 0) - available = (qint64) *((int *) &nbytes); + available = (qint64) nbytes; #if defined (QPROCESS_DEBUG) qDebug("QProcessPrivate::bytesAvailableFromStdout() == %lld", available); #endif @@ -862,10 +862,10 @@ qint64 QProcessPrivate::bytesAvailableFromStdout() const qint64 QProcessPrivate::bytesAvailableFromStderr() const { - size_t nbytes = 0; + int nbytes = 0; qint64 available = 0; if (::ioctl(stderrChannel.pipe[0], FIONREAD, (char *) &nbytes) >= 0) - available = (qint64) *((int *) &nbytes); + available = (qint64) nbytes; #if defined (QPROCESS_DEBUG) qDebug("QProcessPrivate::bytesAvailableFromStderr() == %lld", available); #endif |