1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00
systemd-stable/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)