* [PATCH] tools/acpi: fix inverted logic when closing fd
@ 2016-04-18 22:17 Colin King
0 siblings, 0 replies; only message in thread
From: Colin King @ 2016-04-18 22:17 UTC (permalink / raw)
To: Rafael J . Wysocki, Len Brown, Robert Moore, Lv Zheng, linux-acpi,
devel
Cc: linux-kernel
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-04-18 22:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-18 22:17 [PATCH] tools/acpi: fix inverted logic when closing fd Colin King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).