diff mbox

tools/acpi: fix inverted logic when closing fd

Message ID 1461017871-5395-1-git-send-email-colin.king@canonical.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Colin King April 18, 2016, 10:17 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

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@canonical.com>
---
 tools/power/acpi/tools/acpidbg/acpidbg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

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);