diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-04-04 11:46:44 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-04-12 11:44:57 +0200 |
commit | 2fe21124a6560fcf1ce3b0a3004baa9bb45d1e0b (patch) | |
tree | 35448e5d3a8042bb36bada1fedee63ae24ea7b97 /src/libsystemd/sd-bus | |
parent | b636d78aeeea584b7828df18cb636693af365e2f (diff) | |
download | systemd-2fe21124a6560fcf1ce3b0a3004baa9bb45d1e0b.tar.gz |
Add open_memstream_unlocked() wrapper
Diffstat (limited to 'src/libsystemd/sd-bus')
-rw-r--r-- | src/libsystemd/sd-bus/bus-introspect.c | 6 | ||||
-rw-r--r-- | src/libsystemd/sd-bus/bus-match.c | 6 |
2 files changed, 2 insertions, 10 deletions
diff --git a/src/libsystemd/sd-bus/bus-introspect.c b/src/libsystemd/sd-bus/bus-introspect.c index 29a5ef715e..022eddb10f 100644 --- a/src/libsystemd/sd-bus/bus-introspect.c +++ b/src/libsystemd/sd-bus/bus-introspect.c @@ -1,7 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#include <stdio_ext.h> - #include "bus-internal.h" #include "bus-introspect.h" #include "bus-objects.h" @@ -18,12 +16,10 @@ int introspect_begin(struct introspect *i, bool trusted) { zero(*i); i->trusted = trusted; - i->f = open_memstream(&i->introspection, &i->size); + i->f = open_memstream_unlocked(&i->introspection, &i->size); if (!i->f) return -ENOMEM; - (void) __fsetlocking(i->f, FSETLOCKING_BYCALLER); - fputs(BUS_INTROSPECT_DOCTYPE "<node>\n", i->f); diff --git a/src/libsystemd/sd-bus/bus-match.c b/src/libsystemd/sd-bus/bus-match.c index 266dd7f1df..14204eeb6b 100644 --- a/src/libsystemd/sd-bus/bus-match.c +++ b/src/libsystemd/sd-bus/bus-match.c @@ -1,7 +1,5 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#include <stdio_ext.h> - #include "alloc-util.h" #include "bus-internal.h" #include "bus-match.h" @@ -861,12 +859,10 @@ char *bus_match_to_string(struct bus_match_component *components, unsigned n_com assert(components); - f = open_memstream(&buffer, &size); + f = open_memstream_unlocked(&buffer, &size); if (!f) return NULL; - (void) __fsetlocking(f, FSETLOCKING_BYCALLER); - for (i = 0; i < n_components; i++) { char buf[32]; |