summaryrefslogtreecommitdiffstats
path: root/coccinelle
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2023-07-08 20:33:26 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2023-07-09 07:07:48 +0200
commit906682a1dee6b718ba01194a5e0af92f9a2dc7c1 (patch)
treecf0ffe774d88cdc5a6cb4ee0b98594a31ff959b1 /coccinelle
parentLICENSES/README.md: fix syntax (diff)
downloadsystemd-906682a1dee6b718ba01194a5e0af92f9a2dc7c1.tar.xz
systemd-906682a1dee6b718ba01194a5e0af92f9a2dc7c1.zip
coccinelle/take-fd: match for -EBADF instead of -1
Follow-up for 254d1313ae5a69c08c9b93032aaaf3d6083cfc07
Diffstat (limited to 'coccinelle')
-rw-r--r--coccinelle/take-fd.cocci4
1 files changed, 2 insertions, 2 deletions
diff --git a/coccinelle/take-fd.cocci b/coccinelle/take-fd.cocci
index 396d6965c7..15f1e7c2ce 100644
--- a/coccinelle/take-fd.cocci
+++ b/coccinelle/take-fd.cocci
@@ -4,7 +4,7 @@ local idexpression p;
expression q;
@@
- p = q;
-- q = -1;
+- q = -EBADF;
- return p;
+ return TAKE_FD(q);
@@ -18,5 +18,5 @@ expression p != errno;
expression q;
@@
- p = q;
-- q = -1;
+- q = -EBADF;
+ p = TAKE_FD(q);