Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1382085

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

From Colin King <colin.king@canonical.com>
Newsgroups linux.kernel
Subject [PATCH] tools/acpi: fix inverted logic when closing fd
Date 2016-04-19 00:20 +0200
Message-ID <rppGq-4IL-33@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] tools/acpi: fix inverted logic when closing fd Colin King <colin.king@canonical.com> - 2016-04-19 00:20 +0200

csiph-web