[PATCH] tools/acpi: fix inverted logic when closing fd

From: Colin King
Date: Mon Apr 18 2016 - 18:18:01 EST


From: Colin Ian King <colin.king@xxxxxxxxxxxxx>

The current close on fd only occurs when fd is -ve, it should
actually be closing the file if it a valid fd. Fix the inverted logic.

Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
---
tools/power/acpi/tools/acpidbg/acpidbg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/power/acpi/tools/acpidbg/acpidbg.c b/tools/power/acpi/tools/acpidbg/acpidbg.c
index d070fcc..ebe44dd 100644
--- a/tools/power/acpi/tools/acpidbg/acpidbg.c
+++ b/tools/power/acpi/tools/acpidbg/acpidbg.c
@@ -430,7 +430,7 @@ int main(int argc, char **argv)
acpi_aml_loop(fd);

exit:
- if (fd < 0)
+ if (fd >= 0)
close(fd);
if (acpi_aml_batch_cmd)
free(acpi_aml_batch_cmd);
--
2.7.4