1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00
systemd/coccinelle/dup-fcntl.cocci
Frantisek Sumsal ccd52940d0 coccinelle: further restrict certain transformations
Some transformations generate results we don't want to keep, so
let's disable such transformations for specific files.

Also, disable const-strlen.cocci everywhere, as the STRLEN macro has a
pretty limited scope, so the transformation generates false positives in
most cases.
2019-04-30 09:39:13 +02:00

8 lines
182 B
Plaintext

@@
/* We want to stick with dup() in test-fd-util.c */
position p : script:python() { p[0].file != "src/test/test-fd-util.c" };
expression fd;
@@
- dup@p(fd)
+ fcntl(fd, F_DUPFD, 3)