]> git.ipfire.org Git - thirdparty/systemd.git/blame - coccinelle/close-above-stdio.cocci
mkosi: Build images with --debug to aid debugging in CI
[thirdparty/systemd.git] / coccinelle / close-above-stdio.cocci
CommitLineData
64b92d63 1/* SPDX-License-Identifier: LGPL-2.1-or-later */
e7685a77
LP
2@@
3expression fd;
4@@
5- if (fd > 2)
6- safe_close(fd);
7+ safe_close_above_stdio(fd);
8@@
9expression fd;
10@@
11- if (fd > 2)
12- fd = safe_close(fd);
13+ fd = safe_close_above_stdio(fd);
14@@
15expression fd;
16@@
17- if (fd >= 3)
18- safe_close(fd);
19+ safe_close_above_stdio(fd);
20@@
21expression fd;
22@@
23- if (fd >= 3)
24- fd = safe_close(fd);
25+ fd = safe_close_above_stdio(fd);
26@@
27expression fd;
28@@
29- if (fd > STDERR_FILENO)
30- safe_close(fd);
31+ safe_close_above_stdio(fd);
32@@
33expression fd;
34@@
35- if (fd > STDERR_FILENO)
36- fd = safe_close(fd);
37+ fd = safe_close_above_stdio(fd);