From 65dac2b78c38803f418b331015c801247321dd1b Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 3 Mar 2011 13:56:11 +0200 Subject: Added a note to docs about killing processes in Symbian. Task-number: QT-4659 Reviewed-by: TrustMe --- src/corelib/io/qprocess.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index a44c1e1..5035b79 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -2082,6 +2082,9 @@ void QProcess::terminate() On Symbian, this function requires platform security capability \c PowerMgmt. If absent, the process will panic with KERN-EXEC 46. + \note Killing running processes from other processes will typically + cause a panic in Symbian due to platform security. + \sa {Symbian Platform Security Requirements} \sa terminate() */ -- cgit v0.12 From 25723504d1fc917671dbdeadf441c2ca12145297 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 3 Mar 2011 15:33:04 +0200 Subject: Fix QProcess::waitForFinished WaitForRequest handling in Symbian Waiting for both logonStatus and timerStatus after one has already completed normally could potentially return because some unrelated request completed in the meantime, swallowing the wrong signal. Task-number: QT-4659 Reviewed-by: Janne Koskinen --- src/corelib/io/qprocess_symbian.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/corelib/io/qprocess_symbian.cpp b/src/corelib/io/qprocess_symbian.cpp index d22d1ed..8a74c7b 100644 --- a/src/corelib/io/qprocess_symbian.cpp +++ b/src/corelib/io/qprocess_symbian.cpp @@ -961,16 +961,15 @@ bool QProcessPrivate::waitForFinished(int msecs) User::WaitForRequest(logonStatus, timerStatus); QPROCESS_DEBUG_PRINT("QProcessPrivate::waitForFinished() - Wait completed"); - if (timerStatus == KErrNone) + if (logonStatus != KRequestPending) { + timer.Cancel(); + User::WaitForRequest(timerStatus); + } else { timeoutOccurred = true; - - timer.Cancel(); + symbianProcess->LogonCancel(logonStatus); + User::WaitForRequest(logonStatus); + } timer.Close(); - - symbianProcess->LogonCancel(logonStatus); - - // Eat cancel request completion so that it won't mess up main thread scheduling later - User::WaitForRequest(logonStatus, timerStatus); } } else { QPROCESS_DEBUG_PRINT("QProcessPrivate::waitForFinished(), qt_rprocess_running returned false"); -- cgit v0.12