Diffstat (limited to 'core/launcher/qprocess_unix.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/launcher/qprocess_unix.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/launcher/qprocess_unix.cpp b/core/launcher/qprocess_unix.cpp index 56e1b1d..97c0460 100644 --- a/core/launcher/qprocess_unix.cpp +++ b/core/launcher/qprocess_unix.cpp | |||
@@ -1011,56 +1011,56 @@ void QProcess::socketRead( int fd ) | |||
1011 | odebug << "QProcess::socketRead(): stderr (" << fd << ") closed" << oendl; | 1011 | odebug << "QProcess::socketRead(): stderr (" << fd << ") closed" << oendl; |
1012 | #endif | 1012 | #endif |
1013 | d->notifierStderr->setEnabled( FALSE ); | 1013 | d->notifierStderr->setEnabled( FALSE ); |
1014 | delete d->notifierStderr; | 1014 | delete d->notifierStderr; |
1015 | d->notifierStderr = 0; | 1015 | d->notifierStderr = 0; |
1016 | ::close( d->proc->socketStderr ); | 1016 | ::close( d->proc->socketStderr ); |
1017 | d->proc->socketStderr = 0; | 1017 | d->proc->socketStderr = 0; |
1018 | return; | 1018 | return; |
1019 | } | 1019 | } |
1020 | } | 1020 | } |
1021 | // read all data that is available | 1021 | // read all data that is available |
1022 | while ( n == bufsize ) { | 1022 | while ( n == bufsize ) { |
1023 | oldSize = buffer->size(); | 1023 | oldSize = buffer->size(); |
1024 | buffer->resize( oldSize + bufsize ); | 1024 | buffer->resize( oldSize + bufsize ); |
1025 | n = ::read( fd, buffer->data()+oldSize, bufsize ); | 1025 | n = ::read( fd, buffer->data()+oldSize, bufsize ); |
1026 | if ( n > 0 ) | 1026 | if ( n > 0 ) |
1027 | buffer->resize( oldSize + n ); | 1027 | buffer->resize( oldSize + n ); |
1028 | else | 1028 | else |
1029 | buffer->resize( oldSize ); | 1029 | buffer->resize( oldSize ); |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | d->socketReadCalled = TRUE; | 1032 | d->socketReadCalled = TRUE; |
1033 | if ( fd == d->proc->socketStdout ) { | 1033 | if ( fd == d->proc->socketStdout ) { |
1034 | #if defined(QT_QPROCESS_DEBUG) | 1034 | #if defined(QT_QPROCESS_DEBUG) |
1035 | qDebug( "QProcess::socketRead(): %d bytes read from stdout (%d)", | 1035 | odebug << "QProcess::socketRead(): " << buffer->size()-oldSize << "bytes read from stdout (" |
1036 | buffer->size()-oldSize, fd ); | 1036 | << fd << ")" << oendl; |
1037 | #endif | 1037 | #endif |
1038 | emit readyReadStdout(); | 1038 | emit readyReadStdout(); |
1039 | } else if ( fd == d->proc->socketStderr ) { | 1039 | } else if ( fd == d->proc->socketStderr ) { |
1040 | #if defined(QT_QPROCESS_DEBUG) | 1040 | #if defined(QT_QPROCESS_DEBUG) |
1041 | qDebug( "QProcess::socketRead(): %d bytes read from stderr (%d)", | 1041 | odebug << "QProcess::socketRead(): " << buffer->size()-oldSize << " bytes read from stderr (" |
1042 | buffer->size()-oldSize, fd ); | 1042 | << fd << ")" << oendl; |
1043 | #endif | 1043 | #endif |
1044 | emit readyReadStderr(); | 1044 | emit readyReadStderr(); |
1045 | } | 1045 | } |
1046 | d->socketReadCalled = FALSE; | 1046 | d->socketReadCalled = FALSE; |
1047 | } | 1047 | } |
1048 | 1048 | ||
1049 | 1049 | ||
1050 | /* | 1050 | /* |
1051 | This private slot is called when the process tries to read data from standard | 1051 | This private slot is called when the process tries to read data from standard |
1052 | input. | 1052 | input. |
1053 | */ | 1053 | */ |
1054 | void QProcess::socketWrite( int fd ) | 1054 | void QProcess::socketWrite( int fd ) |
1055 | { | 1055 | { |
1056 | if ( fd != d->proc->socketStdin || d->proc->socketStdin == 0 ) | 1056 | if ( fd != d->proc->socketStdin || d->proc->socketStdin == 0 ) |
1057 | return; | 1057 | return; |
1058 | if ( d->stdinBuf.isEmpty() ) { | 1058 | if ( d->stdinBuf.isEmpty() ) { |
1059 | d->notifierStdin->setEnabled( FALSE ); | 1059 | d->notifierStdin->setEnabled( FALSE ); |
1060 | return; | 1060 | return; |
1061 | } | 1061 | } |
1062 | #if defined(QT_QPROCESS_DEBUG) | 1062 | #if defined(QT_QPROCESS_DEBUG) |
1063 | odebug << "QProcess::socketWrite(): write to stdin (" << fd << ")" << oendl; | 1063 | odebug << "QProcess::socketWrite(): write to stdin (" << fd << ")" << oendl; |
1064 | #endif | 1064 | #endif |
1065 | ssize_t ret = ::write( fd, | 1065 | ssize_t ret = ::write( fd, |
1066 | d->stdinBuf.head()->data() + d->stdinBufRead, | 1066 | d->stdinBuf.head()->data() + d->stdinBufRead, |