aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2019-07-10 09:31:05 -0400
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2019-07-18 17:01:52 -0400
commitcb91f641c3c2f85c4142af3e7965580350af081e (patch)
tree0ccca8c2dea123a72ec723b72b83eb10744a30ff
parent2e15c98bd394e42f45cfdd638727e57090149137 (diff)
downloadtrace-cmd-cb91f641c3c2f85c4142af3e7965580350af081e.tar.gz
revert: "kernel-shark: Remove a duplicate error message"
It turns out that if the kshark-record dialog does not show up for some reason, then without this "duplicate" message, the user gets no message at all to why the dialog did not appear. Link: http://lkml.kernel.org/r/20190710134725.144595473@goodmis.org Reviewed-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r--kernel-shark/src/KsMainWindow.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp
index 8826cf5c..198b4104 100644
--- a/kernel-shark/src/KsMainWindow.cpp
+++ b/kernel-shark/src/KsMainWindow.cpp
@@ -1154,9 +1154,35 @@ void KsMainWindow::_captureStarted()
_captureLocalServer.listen("KSCapture");
}
+/**
+ * If the authorization could not be obtained because the user dismissed
+ * the authentication dialog (clicked Cancel), pkexec exits with a return
+ * value of 126.
+ */
+#define PKEXEC_DISMISS_RET 126
+
void KsMainWindow::_captureFinished(int ret, QProcess::ExitStatus st)
{
+ QProcess *capture = (QProcess *)sender();
+
_captureLocalServer.close();
+
+ if (ret == PKEXEC_DISMISS_RET) {
+ /*
+ * Authorization could not be obtained because the user
+ * dismissed the authentication dialog.
+ */
+ return;
+ }
+
+ if (ret != 0 || st != QProcess::NormalExit) {
+ QString message = "Capture process failed:<br>";
+
+ message += capture->errorString();
+ message += "<br>Try doing:<br> sudo make install";
+
+ _error(message, "captureFinishedErr", false, false);
+ }
}
void KsMainWindow::_captureError(QProcess::ProcessError error)