valeriyvdovin / rpms / systemd

Forked from rpms/systemd 4 years ago
Clone

Blame SOURCES/0792-lgtm-suppress-several-constant-comparisons.patch

661545
From 1499ff8f8ddd699a950729f5f3985975ef929c0a Mon Sep 17 00:00:00 2001
661545
From: Frantisek Sumsal <fsumsal@redhat.com>
661545
Date: Thu, 28 Feb 2019 14:27:44 +0100
661545
Subject: [PATCH] lgtm: suppress several constant comparisons
661545
661545
Even though LGTM is right is these cases, fixing it would require
661545
substantial refactoring in some cases, so it's better to leave them
661545
here (at least for RHEL 7).
661545
661545
Resolves: #1694605
661545
rhel-only
661545
---
661545
 src/sysv-generator/sysv-generator.c                 | 2 +-
661545
 src/tty-ask-password-agent/tty-ask-password-agent.c | 2 +-
661545
 2 files changed, 2 insertions(+), 2 deletions(-)
661545
661545
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
661545
index fe6fae1510..232436a258 100644
661545
--- a/src/sysv-generator/sysv-generator.c
661545
+++ b/src/sysv-generator/sysv-generator.c
661545
@@ -568,7 +568,7 @@ static int load_sysv(SysvStub *s) {
661545
                                                 }
661545
                                         }
661545
 
661545
-                                        if (r < 0)
661545
+                                        if (r < 0) // lgtm[cpp/constant-comparison]
661545
                                                 log_unit_error(s->name,
661545
                                                                "[%s:%u] Failed to add dependency on %s, ignoring: %s",
661545
                                                                s->path, line, m, strerror(-r));
661545
diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c
661545
index 47093b850d..1b7bbfa075 100644
661545
--- a/src/tty-ask-password-agent/tty-ask-password-agent.c
661545
+++ b/src/tty-ask-password-agent/tty-ask-password-agent.c
661545
@@ -150,7 +150,7 @@ static int ask_password_plymouth(
661545
 
661545
                 p += k;
661545
 
661545
-                if (p < 1)
661545
+                if (p < 1) // lgtm[cpp/constant-comparison]
661545
                         continue;
661545
 
661545
                 if (buffer[0] == 5) {