ryantimwilson / rpms / systemd

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