summaryrefslogtreecommitdiffstats
path: root/coccinelle/close-above-stdio.cocci
blob: 44b3b1c9f1e1977b8f4820644ee956cde589373d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
@@
expression fd;
@@
- if (fd > 2)
- safe_close(fd);
+ safe_close_above_stdio(fd);
@@
expression fd;
@@
- if (fd > 2)
- fd = safe_close(fd);
+ fd = safe_close_above_stdio(fd);
@@
expression fd;
@@
- if (fd >= 3)
- safe_close(fd);
+ safe_close_above_stdio(fd);
@@
expression fd;
@@
- if (fd >= 3)
- fd = safe_close(fd);
+ fd = safe_close_above_stdio(fd);
@@
expression fd;
@@
- if (fd > STDERR_FILENO)
- safe_close(fd);
+ safe_close_above_stdio(fd);
@@
expression fd;
@@
- if (fd > STDERR_FILENO)
- fd = safe_close(fd);
+ fd = safe_close_above_stdio(fd);