diff options
author | Sebastian Scheibner <asamk@gmx.de> | 2020-05-22 10:37:43 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-09-06 18:00:33 +0200 |
commit | bdff06de069fc83f18a126bf6b899ae2341572c3 (patch) | |
tree | 05ccd27730c0f0ccec09b8af7a6e5ec2f1a1b90e /src/busctl | |
parent | man: fix static bridge example (diff) | |
download | systemd-bdff06de069fc83f18a126bf6b899ae2341572c3.tar.xz systemd-bdff06de069fc83f18a126bf6b899ae2341572c3.zip |
busctl: Fix warning about invaild introspection data
The set_put function returns 0 if the element is already in the set and
not EEXIST, like e.g. hashmap does.
Diffstat (limited to 'src/busctl')
-rw-r--r-- | src/busctl/busctl.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index 0f97015bd4..c637d084e7 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -809,8 +809,9 @@ static int on_interface(const char *interface, uint64_t flags, void *userdata) { return log_oom(); r = set_put(members, m); - if (r == -EEXIST) - return log_error_errno(r, "Invalid introspection data: duplicate interface '%s'.", interface); + if (r == 0) + return log_error_errno(SYNTHETIC_ERRNO(EEXIST), + "Invalid introspection data: duplicate interface '%s'.", interface); if (r < 0) return log_oom(); @@ -852,8 +853,9 @@ static int on_method(const char *interface, const char *name, const char *signat return log_oom(); r = set_put(members, m); - if (r == -EEXIST) - return log_error_errno(r, "Invalid introspection data: duplicate method '%s' on interface '%s'.", name, interface); + if (r == 0) + return log_error_errno(SYNTHETIC_ERRNO(EEXIST), + "Invalid introspection data: duplicate method '%s' on interface '%s'.", name, interface); if (r < 0) return log_oom(); @@ -891,8 +893,9 @@ static int on_signal(const char *interface, const char *name, const char *signat return log_oom(); r = set_put(members, m); - if (r == -EEXIST) - return log_error_errno(r, "Invalid introspection data: duplicate signal '%s' on interface '%s'.", name, interface); + if (r == 0) + return log_error_errno(SYNTHETIC_ERRNO(EEXIST), + "Invalid introspection data: duplicate signal '%s' on interface '%s'.", name, interface); if (r < 0) return log_oom(); @@ -931,8 +934,9 @@ static int on_property(const char *interface, const char *name, const char *sign return log_oom(); r = set_put(members, m); - if (r == -EEXIST) - return log_error_errno(r, "Invalid introspection data: duplicate property '%s' on interface '%s'.", name, interface); + if (r == 0) + return log_error_errno(SYNTHETIC_ERRNO(EEXIST), + "Invalid introspection data: duplicate property '%s' on interface '%s'.", name, interface); if (r < 0) return log_oom(); |