mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
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.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
bc33789a06
commit
bdff06de06
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user