]> git.ipfire.org Git - thirdparty/systemd.git/blob - coccinelle/safe_closedir.cocci
Merge pull request #20787 from fbuihuu/watchdog-more-rework
[thirdparty/systemd.git] / coccinelle / safe_closedir.cocci
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 @@
3 expression p;
4 @@
5 - if (p) {
6 - closedir(p);
7 - p = NULL;
8 - }
9 + p = safe_closedir(p);
10 @@
11 expression p;
12 @@
13 - if (p)
14 - closedir(p);
15 - p = NULL;
16 + p = safe_closedir(p);
17 @@
18 expression p;
19 @@
20 - closedir(p);
21 - p = NULL;
22 + p = safe_closedir(p);
23 @@
24 expression p;
25 @@
26 - if (p)
27 - closedir(p);
28 + safe_closedir(p);