]> git.ipfire.org Git - thirdparty/systemd.git/blob - coccinelle/safe_close.cocci
36a853725176c872d0674f95b93a494fa9d48b93
[thirdparty/systemd.git] / coccinelle / safe_close.cocci
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 @@
3 expression fd;
4 @@
5 - close(fd);
6 - fd = -1;
7 + fd = safe_close(fd);
8 @@
9 expression fd;
10 @@
11 - close_nointr(fd);
12 - fd = -1;
13 + fd = safe_close(fd);
14 @@
15 expression fd;
16 @@
17 - safe_close(fd);
18 - fd = -1;
19 + fd = safe_close(fd);