summaryrefslogtreecommitdiffstats
path: root/coccinelle/fopen-unlocked.cocci
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-04-04 11:46:44 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-04-12 11:44:57 +0200
commit2fe21124a6560fcf1ce3b0a3004baa9bb45d1e0b (patch)
tree35448e5d3a8042bb36bada1fedee63ae24ea7b97 /coccinelle/fopen-unlocked.cocci
parentcore/smack-setup: add helper function for openat+fdopen (diff)
downloadsystemd-2fe21124a6560fcf1ce3b0a3004baa9bb45d1e0b.tar.xz
systemd-2fe21124a6560fcf1ce3b0a3004baa9bb45d1e0b.zip
Add open_memstream_unlocked() wrapper
Diffstat (limited to 'coccinelle/fopen-unlocked.cocci')
-rw-r--r--coccinelle/fopen-unlocked.cocci8
1 files changed, 8 insertions, 0 deletions
diff --git a/coccinelle/fopen-unlocked.cocci b/coccinelle/fopen-unlocked.cocci
index bbd70a6338..7870f8ccea 100644
--- a/coccinelle/fopen-unlocked.cocci
+++ b/coccinelle/fopen-unlocked.cocci
@@ -61,3 +61,11 @@ expression f, fd, options;
+ return r;
}
- (void) __fsetlocking(f, FSETLOCKING_BYCALLER);
+@@
+expression f, buf, sz;
+@@
+- f = open_memstream(&buf, &sz);
++ f = open_memstream_unlocked(&buf, &sz);
+ if (!f)
+ return ...;
+- (void) __fsetlocking(f, FSETLOCKING_BYCALLER);