From 7f6e12b03300ba3e473ce6b85d823fc0375b335e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 8 Sep 2015 18:58:28 +0200 Subject: tree-wide: drop redundant if checks before safe_close() Replace this: if (fd >= 0) safe_close(fd); by this: safe_close(fd); --- coccinelle/safe_close-no-if.cocci | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 coccinelle/safe_close-no-if.cocci (limited to 'coccinelle') diff --git a/coccinelle/safe_close-no-if.cocci b/coccinelle/safe_close-no-if.cocci new file mode 100644 index 0000000000..81c5678518 --- /dev/null +++ b/coccinelle/safe_close-no-if.cocci @@ -0,0 +1,7 @@ +@@ +expression fd; +@@ +- if (fd >= 0) { +- fd = safe_close(fd); +- } ++ fd = safe_close(fd); -- cgit v1.2.3-54-g00ecf