summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess_unix.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2015-11-09 12:53:54 +0100
committerKai Koehne <kai.koehne@theqtcompany.com>2015-11-12 14:17:40 +0000
commit351853e04d585cc7e9098140fb50920d99597629 (patch)
tree053ce81a7375d9912bfc9f1d154b65b66bd08fd2 /src/corelib/io/qprocess_unix.cpp
parent4890c75d0d301fcfea594a5ad80577d0ffa6bb88 (diff)
Do not overwrite detailed error message if process fails to launch
On Unix we get a detailed error message when a process fails to start, but later on we overwrite it with a generic "Process fails to start". Fix this by keeping the original error message (if one is available). This fixes a regression introduced in commit 5147f73ac3. Task-number: QTBUG-49286 Change-Id: Idd0f0fed9773d39f2947fc3e532b51e670952caf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qprocess_unix.cpp')
-rw-r--r--src/corelib/io/qprocess_unix.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 63480dfc6b..a5488f48cc 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -714,7 +714,7 @@ report_errno:
}
#endif
-bool QProcessPrivate::processStarted()
+bool QProcessPrivate::processStarted(QString *errorMessage)
{
ushort buf[errorBufferMax];
int i = qt_safe_read(childStartedPipe[0], &buf, sizeof buf);
@@ -731,8 +731,8 @@ bool QProcessPrivate::processStarted()
#endif
// did we read an error message?
- if (i > 0)
- q_func()->setErrorString(QString((const QChar *)buf, i / sizeof(QChar)));
+ if ((i > 0) && errorMessage)
+ *errorMessage = QString((const QChar *)buf, i / sizeof(QChar));
return i <= 0;
}