提交 4c248e93 编写于 作者: E Erik Skultety

maint: Fix incorrect parenthesis placement causing true/false assignment

There were a few places in our code where the following pattern in 'if'
condition occurred:

if ((foo = bar() < 0))
    do something;

This patch adjusts the conditions to the expected format:

if ((foo = bar()) < 0)
    do something;

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1488192Signed-off-by: NErik Skultety <eskultet@redhat.com>
Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
上级 a2b240e6
......@@ -446,7 +446,7 @@ adminDispatchConnectGetLoggingOutputs(virNetServerPtr server ATTRIBUTE_UNUSED,
char *outputs = NULL;
int noutputs = 0;
if ((noutputs = adminConnectGetLoggingOutputs(&outputs, args->flags) < 0)) {
if ((noutputs = adminConnectGetLoggingOutputs(&outputs, args->flags)) < 0) {
virNetMessageSaveError(rerr);
return -1;
}
......
......@@ -1310,7 +1310,7 @@ int main(int argc, char **argv) {
}
srv = virNetDaemonGetServer(lockDaemon->dmn, "virtlockd");
if ((rv = virLockDaemonSetupNetworkingSystemD(srv) < 0)) {
if ((rv = virLockDaemonSetupNetworkingSystemD(srv)) < 0) {
ret = VIR_LOCK_DAEMON_ERR_NETWORK;
goto cleanup;
}
......
......@@ -313,7 +313,7 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriverPtr driver)
goto error_unlink;
}
if ((rv = virLockManagerSanlockInitLockspace(driver, &ls) < 0)) {
if ((rv = virLockManagerSanlockInitLockspace(driver, &ls)) < 0) {
char *err = NULL;
if (virLockManagerSanlockError(rv, &err)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
......
......@@ -5270,7 +5270,7 @@ qemuDomainDetachRNGDevice(virQEMUDriverPtr driver,
int rc;
int ret = -1;
if ((idx = virDomainRNGFind(vm->def, rng) < 0)) {
if ((idx = virDomainRNGFind(vm->def, rng)) < 0) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("device not present in domain configuration"));
return -1;
......
......@@ -424,7 +424,7 @@ void testTLSWriteCertChain(const char *filename,
for (i = 0; i < ncerts; i++) {
size = sizeof(buffer);
if ((err = gnutls_x509_crt_export(certs[i], GNUTLS_X509_FMT_PEM, buffer, &size) < 0)) {
if ((err = gnutls_x509_crt_export(certs[i], GNUTLS_X509_FMT_PEM, buffer, &size)) < 0) {
VIR_WARN("Failed to export certificate %s", gnutls_strerror(err));
unlink(filename);
abort();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册