diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-03-20 20:57:37 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-03-20 22:31:14 +0100 |
commit | 43dc7aa2ba9e2e943b7bde47ce707fd1c0b778b1 (patch) | |
tree | 1c07bcabde02048d181c5b63d6ba0e136dcf248e /coccinelle | |
parent | coccinelle: make use of DIV_ROUND_UP() wherever appropriate (diff) | |
download | systemd-43dc7aa2ba9e2e943b7bde47ce707fd1c0b778b1.tar.gz systemd-43dc7aa2ba9e2e943b7bde47ce707fd1c0b778b1.tar.bz2 systemd-43dc7aa2ba9e2e943b7bde47ce707fd1c0b778b1.zip |
coccinelle: always use fcntl(fd, FD_DUPFD, 3) instead of dup(fd)
Let's avoid fds 0…2 for safety reasons.
Diffstat (limited to 'coccinelle')
-rw-r--r-- | coccinelle/dup-fcntl.cocci | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/coccinelle/dup-fcntl.cocci b/coccinelle/dup-fcntl.cocci new file mode 100644 index 000000000..ef1356428 --- /dev/null +++ b/coccinelle/dup-fcntl.cocci @@ -0,0 +1,5 @@ +@@ +expression fd; +@@ +- dup(fd) ++ fcntl(fd, F_DUPFD, 3) |