diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-04-04 11:27:08 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-04-12 11:44:57 +0200 |
commit | 02e23d1a1a8c3baf73d82da5abbab3a4eeb1cbf4 (patch) | |
tree | a7b7f26ec3058af9278cd4e2e40f87d4232bdf94 /coccinelle | |
parent | 41f6e627d7cfdf1ea50d5adbd7e118589dbcf8db (diff) | |
download | systemd-02e23d1a1a8c3baf73d82da5abbab3a4eeb1cbf4.tar.gz |
Add fdopen_unlocked() wrapper
Diffstat (limited to 'coccinelle')
-rw-r--r-- | coccinelle/fopen-unlocked.cocci | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/coccinelle/fopen-unlocked.cocci b/coccinelle/fopen-unlocked.cocci index e6f2bc5681..bbd70a6338 100644 --- a/coccinelle/fopen-unlocked.cocci +++ b/coccinelle/fopen-unlocked.cocci @@ -49,3 +49,15 @@ expression f, g, path, p; if (r < 0) return ...; - (void) __fsetlocking(f, FSETLOCKING_BYCALLER); +@@ +expression f, fd, options; +@@ +- f = fdopen(fd, options); ++ r = fdopen_unlocked(fd, options, &f); ++ if (r < 0) { +- if (!f) { + ... +- return -errno; ++ return r; + } +- (void) __fsetlocking(f, FSETLOCKING_BYCALLER); |