Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.4:Update
kpmcore
0001-Set-false-as-the-default-return-value-and-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Set-false-as-the-default-return-value-and-change-it-.patch of Package kpmcore
From 7e7202a02de3a0b531ddc59d79196659fc97ec82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= <andrius@stikonas.eu> Date: Tue, 15 Feb 2022 19:56:46 +0000 Subject: [PATCH] Set "false" as the default return value and change it to "true" on success. --- src/util/externalcommandhelper.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/util/externalcommandhelper.cpp b/src/util/externalcommandhelper.cpp index a61dcba..58edd93 100644 --- a/src/util/externalcommandhelper.cpp +++ b/src/util/externalcommandhelper.cpp @@ -334,10 +334,9 @@ QVariantMap ExternalCommandHelper::RunCommand(const QString& command, const QStr } QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8")); QVariantMap reply; - reply[QStringLiteral("success")] = true; + reply[QStringLiteral("success")] = false; if (command.isEmpty()) { - reply[QStringLiteral("success")] = false; return reply; } @@ -345,7 +344,6 @@ QVariantMap ExternalCommandHelper::RunCommand(const QString& command, const QStr QString basename = command.mid(command.lastIndexOf(QLatin1Char('/')) + 1); if (allowedCommands.find(basename) == allowedCommands.end()) { // TODO: C++20: replace with contains qInfo() << command <<" command is not one of the whitelisted command"; - reply[QStringLiteral("success")] = false; return reply; } @@ -355,7 +353,6 @@ QVariantMap ExternalCommandHelper::RunCommand(const QString& command, const QStr cmd.setEnvironment( { QStringLiteral("LVM_SUPPRESS_FD_WARNINGS=1") } ); if((processChannelMode != QProcess::SeparateChannels) && (processChannelMode != QProcess::MergedChannels)) { - reply[QStringLiteral("success")] = false; return reply; } cmd.setProcessChannelMode(static_cast<QProcess::ProcessChannelMode>(processChannelMode)); @@ -367,6 +364,7 @@ QVariantMap ExternalCommandHelper::RunCommand(const QString& command, const QStr reply[QStringLiteral("output")] = output; reply[QStringLiteral("exitCode")] = cmd.exitCode(); + reply[QStringLiteral("success")] = true; return reply; } -- 2.35.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor