summaryrefslogtreecommitdiff
path: root/src/test/test-json.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-04-04 12:24:38 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-04-12 11:44:57 +0200
commit673a1e6fb9ea2b61d97be45b8f9852c70a69778c (patch)
treebbba913ad7c9353ac80367d50bac29a8d96b7ce5 /src/test/test-json.c
parent2fe21124a6560fcf1ce3b0a3004baa9bb45d1e0b (diff)
downloadsystemd-673a1e6fb9ea2b61d97be45b8f9852c70a69778c.tar.gz
Add fmemopen_unlocked() and use unlocked ops in fuzzers and some other tests
This might make things marginially faster. I didn't benchmark though.
Diffstat (limited to 'src/test/test-json.c')
-rw-r--r--src/test/test-json.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/test-json.c b/src/test/test-json.c
index 9b8a2a9422..8bd6a7221c 100644
--- a/src/test/test-json.c
+++ b/src/test/test-json.c
@@ -4,6 +4,7 @@
#include "alloc-util.h"
#include "fd-util.h"
+#include "fileio.h"
#include "json-internal.h"
#include "json.h"
#include "string-util.h"
@@ -358,7 +359,7 @@ static void test_source(void) {
"%s"
"--- original end ---\n", data);
- assert_se(f = fmemopen((void*) data, strlen(data), "r"));
+ assert_se(f = fmemopen_unlocked((void*) data, strlen(data), "r"));
assert_se(json_parse_file(f, "waldo", &v, NULL, NULL) >= 0);