Files
systemd/coccinelle/dup-fcntl.cocci
T
Frantisek Sumsal 6dcabd5f5e coccinelle: simplify file exclusions
Use Coccinelle's "depends on" directive to exclude files from certain
transformations. This should make them a bit simpler and possibly
faster, since we don't have to shell out to Python.

Unfortunately, this works only for file/directory exclusions. For
function and other more complex exclusions we still need to use Python,
at least for now.

Also, completely drop the file exclusion for man/ in the xsprintf
transformation, since we filter out everything under man/ before we even
run Coccinelle (in run-coccinelle.sh).
2026-03-14 23:56:53 +00:00

8 lines
205 B
Plaintext

/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* We want to stick with dup() in test-fd-util.c */
@ depends on !(file in "src/test/test-fd-util.c") @
expression fd;
@@
- dup(fd)
+ fcntl(fd, F_DUPFD, 3)