summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/adminauthorization_x11.cpp
diff options
context:
space:
mode:
authorFrerich Raabe <raabe@froglogic.com>2016-02-11 10:04:19 +0100
committerKatja Marttila <katja.marttila@theqtcompany.com>2016-02-19 10:52:40 +0000
commit63c91e70dcccd215095b822712159a499a840825 (patch)
treeaeab67a3d3eb47468a08f76a397f1968f134730f /src/libs/installer/adminauthorization_x11.cpp
parentac246255fbbf75f385b2bbbcbe00513c367aad9e (diff)
Don't print error messages in case correct sudo password is entered
Any stderr data printed by 'sudo' was always printed as part of an error message box, even if sudo succeeded. This issue is triggered very easily by entering a wrong root password first, and then the correct password on the second try. Let's just print stderr data in case we have some *and* in case 'sudo' returns a non-zero return code. Change-Id: Icbb2d31cdf5c4d5d20ed4200553e9bf7e2b5bedd Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com>
Diffstat (limited to 'src/libs/installer/adminauthorization_x11.cpp')
-rw-r--r--src/libs/installer/adminauthorization_x11.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libs/installer/adminauthorization_x11.cpp b/src/libs/installer/adminauthorization_x11.cpp
index f3372ddd2..063f9a84e 100644
--- a/src/libs/installer/adminauthorization_x11.cpp
+++ b/src/libs/installer/adminauthorization_x11.cpp
@@ -205,13 +205,15 @@ bool AdminAuthorization::execute(QWidget *parent, const QString &program, const
if (bytes == 0)
::usleep(100000);
}
- if (!errData.isEmpty()) {
+
+ const bool success = statusValid && WIFEXITED(status) && WEXITSTATUS(status) == 0;
+
+ if (!success && !errData.isEmpty()) {
printError(parent, QString::fromLocal8Bit(errData.constData()));
- return false;
}
::close(pipedData[1]);
- return statusValid && WIFEXITED(status) && WEXITSTATUS(status) == 0;
+ return success;
}
// child process