diff options
author | Sven Eden <yamakuzure@gmx.net> | 2017-05-24 13:51:31 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-06-16 10:12:58 +0200 |
commit | c733f9b08d9eadc5e671185112567ada81116bdf (patch) | |
tree | 5755965b950423eae4b3c8f462acaf940a9ad684 /src/basic/hashmap.c | |
parent | c6edc23d5f8a483e93a891bf7eb76b5f4caf2fb4 (diff) |
Prep v230: Apply missing upstream fixes and updates (2/8) src/basic.
Diffstat (limited to 'src/basic/hashmap.c')
-rw-r--r-- | src/basic/hashmap.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c index 75ea2e30b..c89630f04 100644 --- a/src/basic/hashmap.c +++ b/src/basic/hashmap.c @@ -1777,20 +1777,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); } #if 0 /// UNNEEDED by elogind |