summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Meerwald-Stadler <pmeerw@pmeerw.net>2017-03-07 16:09:56 +0100
committerPeter Meerwald-Stadler <pmeerw@pmeerw.net>2017-03-10 10:17:40 +0100
commiteab0b9d83bccf470fd0b392e358f7bcd63420c77 (patch)
tree2a9f70c7ab4132abcdfc547cb944255e4577e85d
parent976f7e9a61e026de9d976a7e35b13cdd0314b0a1 (diff)
core: Ignore pa_shared_remove() return value
document behaviour of pa_shared_remove() in case name does not exist Coverity ID: #1380672 thanks to Georg Chini for suggesting to swap patch title and commit message Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
-rw-r--r--src/pulsecore/shared.c2
-rw-r--r--src/pulsecore/shared.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/pulsecore/shared.c b/src/pulsecore/shared.c
index 1b5eea98..9bc7eb56 100644
--- a/src/pulsecore/shared.c
+++ b/src/pulsecore/shared.c
@@ -111,6 +111,6 @@ int pa_shared_replace(pa_core *c, const char *name, void *data) {
pa_assert(c);
pa_assert(name);
- pa_shared_remove(c, name);
+ (void) pa_shared_remove(c, name);
return pa_shared_set(c, name, data);
}
diff --git a/src/pulsecore/shared.h b/src/pulsecore/shared.h
index 49e87387..19ac462c 100644
--- a/src/pulsecore/shared.h
+++ b/src/pulsecore/shared.h
@@ -44,7 +44,9 @@ int pa_shared_set(pa_core *c, const char *name, void *data);
/* Remove the specified shared property. Return non-zero on failure */
int pa_shared_remove(pa_core *c, const char *name);
-/* A combination of pa_shared_remove() and pa_shared_set() */
+/* A combination of pa_shared_remove() and pa_shared_set(); this function
+ * first tries to remove the property by this name and then sets the
+ * property. Return non-zero on failure. */
int pa_shared_replace(pa_core *c, const char *name, void *data);
/* Dump the current set of shared properties */