]> git.ipfire.org Git - thirdparty/systemd.git/blob - coccinelle/close-above-stdio.cocci
test: also flush and rotate journal before read
[thirdparty/systemd.git] / coccinelle / close-above-stdio.cocci
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 @@
3 expression fd;
4 @@
5 - if (fd > 2)
6 - safe_close(fd);
7 + safe_close_above_stdio(fd);
8 @@
9 expression fd;
10 @@
11 - if (fd > 2)
12 - fd = safe_close(fd);
13 + fd = safe_close_above_stdio(fd);
14 @@
15 expression fd;
16 @@
17 - if (fd >= 3)
18 - safe_close(fd);
19 + safe_close_above_stdio(fd);
20 @@
21 expression fd;
22 @@
23 - if (fd >= 3)
24 - fd = safe_close(fd);
25 + fd = safe_close_above_stdio(fd);
26 @@
27 expression fd;
28 @@
29 - if (fd > STDERR_FILENO)
30 - safe_close(fd);
31 + safe_close_above_stdio(fd);
32 @@
33 expression fd;
34 @@
35 - if (fd > STDERR_FILENO)
36 - fd = safe_close(fd);
37 + fd = safe_close_above_stdio(fd);