summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-04-30 18:00:46 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-04-30 18:00:46 -0400
commitbc1d8669b8339e8c9420f42b0662bfffa98f320e (patch)
tree2c42ab297e6f4c9b98f65ba5bcc50b3d2df36364 /src/basic
parentb79660e6acb964f94ddba0ea4e1182215934dfc3 (diff)
parentf4bf8d2f45b02c26234219d07bfd3a41290cc84e (diff)
Merge pull request #3152 from poettering/aliasfix
Refuse aliases to non-aliasable units in more places Fixes #2730.
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/hashmap.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c
index 85b8d812b3..49a0479592 100644
--- a/src/basic/hashmap.c
+++ b/src/basic/hashmap.c
@@ -1773,20 +1773,18 @@ int set_consume(Set *s, void *value) {
int set_put_strdup(Set *s, const char *p) {
char *c;
- int r;
assert(s);
assert(p);
+ if (set_contains(s, (char*) p))
+ return 0;
+
c = strdup(p);
if (!c)
return -ENOMEM;
- r = set_consume(s, c);
- if (r == -EEXIST)
- return 0;
-
- return r;
+ return set_consume(s, c);
}
int set_put_strdupv(Set *s, char **l) {