Blame SOURCES/0787-systemctl-set_put-can-t-return-EEXIST.patch
|
|
661545 |
From 732efbce6725db08a527e14d34f4e10e51fae965 Mon Sep 17 00:00:00 2001
|
|
|
661545 |
From: Frantisek Sumsal <fsumsal@redhat.com>
|
|
|
661545 |
Date: Thu, 28 Feb 2019 11:35:53 +0100
|
|
|
661545 |
Subject: [PATCH] systemctl: set_put() can't return (-)EEXIST
|
|
|
661545 |
|
|
|
661545 |
set_put() returns 0 if the key already exists, 1 if the entry
|
|
|
661545 |
was inserted successfully, and -ENOMEM otherwise.
|
|
|
661545 |
|
|
|
661545 |
See: set_put(), hashmap_base_put_boldly()
|
|
|
661545 |
|
|
|
661545 |
Found by LGTM.
|
|
|
661545 |
|
|
|
661545 |
Resolves: #1694605
|
|
|
661545 |
---
|
|
|
661545 |
src/systemctl/systemctl.c | 2 +-
|
|
|
661545 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
661545 |
|
|
|
661545 |
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
|
|
|
661545 |
index 398727cc7d..83c418f0b7 100644
|
|
|
661545 |
--- a/src/systemctl/systemctl.c
|
|
|
661545 |
+++ b/src/systemctl/systemctl.c
|
|
|
661545 |
@@ -4310,7 +4310,7 @@ static int show_one(
|
|
|
661545 |
return log_oom();
|
|
|
661545 |
|
|
|
661545 |
r = set_put(found_properties, name);
|
|
|
661545 |
- if (r < 0 && r != EEXIST)
|
|
|
661545 |
+ if (r < 0)
|
|
|
661545 |
return log_oom();
|
|
|
661545 |
|
|
|
661545 |
r = print_property(name, reply, contents);
|