From 43dc7aa2ba9e2e943b7bde47ce707fd1c0b778b1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 20 Mar 2018 20:57:37 +0100 Subject: coccinelle: always use fcntl(fd, FD_DUPFD, 3) instead of dup(fd) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's avoid fds 0…2 for safety reasons. --- coccinelle/dup-fcntl.cocci | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 coccinelle/dup-fcntl.cocci (limited to 'coccinelle') 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) -- cgit v1.2.3-65-gdbad