ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
803fb7
From 10cfa6f617fdc2b9d85823163b4445f5ae9058c5 Mon Sep 17 00:00:00 2001
803fb7
From: Daniel Mack <daniel@zonque.org>
803fb7
Date: Tue, 24 Feb 2015 16:18:43 +0100
803fb7
Subject: [PATCH] shared/unit-name: fix gcc5 warning
803fb7
803fb7
Fix the following gcc5 warning:
803fb7
803fb7
  CC       src/shared/libsystemd_shared_la-unit-name.lo
803fb7
src/shared/unit-name.c: In function 'unit_name_is_valid':
803fb7
src/shared/unit-name.c:102:34: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
803fb7
                 if (!template_ok == TEMPLATE_VALID && at+1 == e)
803fb7
                                  ^
803fb7
803fb7
(cherry picked from commit f9bf3e260c480f7b660bec3f78a13f52a46ec34d)
803fb7
---
803fb7
 src/shared/unit-name.c | 2 +-
803fb7
 1 file changed, 1 insertion(+), 1 deletion(-)
803fb7
803fb7
diff --git a/src/shared/unit-name.c b/src/shared/unit-name.c
803fb7
index 21b66913c..f728af4a8 100644
803fb7
--- a/src/shared/unit-name.c
803fb7
+++ b/src/shared/unit-name.c
803fb7
@@ -100,7 +100,7 @@ bool unit_name_is_valid(const char *n, enum template_valid template_ok) {
803fb7
                 if (at == n)
803fb7
                         return false;
803fb7
 
803fb7
-                if (!template_ok == TEMPLATE_VALID && at+1 == e)
803fb7
+                if (template_ok != TEMPLATE_VALID && at+1 == e)
803fb7
                         return false;
803fb7
         }
803fb7