systemd/coccinelle/dup-fcntl.cocci
Lennart Poettering 43dc7aa2ba coccinelle: always use fcntl(fd, FD_DUPFD, 3) instead of dup(fd)
Let's avoid fds 0…2 for safety reasons.
2018-03-20 22:31:14 +01:00

6 lines
55 B
Plaintext

@@
expression fd;
@@
- dup(fd)
+ fcntl(fd, F_DUPFD, 3)