systemd/coccinelle/safe_close-no-if.cocci
Lennart Poettering 7f6e12b033 tree-wide: drop redundant if checks before safe_close()
Replace this:

        if (fd >= 0)
                safe_close(fd);

by this:

        safe_close(fd);
2015-09-09 08:20:19 +02:00

7 lines
88 B
Text

@@
expression fd;
@@
- if (fd >= 0) {
- fd = safe_close(fd);
- }
+ fd = safe_close(fd);