]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - coccinelle/fopen-unlocked.cocci
Add open_memstream_unlocked() wrapper
[thirdparty/systemd.git] / coccinelle / fopen-unlocked.cocci
index bbd70a6338dabb5fd41a467c7ebc1777c2059c03..7870f8ccea09bfdfc8f196aec6e00990f6a5c81d 100644 (file)
@@ -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);