From: Colin King <colin.king@canonical.com>
To: "Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
Len Brown <lenb@kernel.org>,
Robert Moore <robert.moore@intel.com>,
Lv Zheng <lv.zheng@intel.com>,
linux-acpi@vger.kernel.org, devel@acpica.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] tools/acpi: fix inverted logic when closing fd
Date: Mon, 18 Apr 2016 23:17:51 +0100 [thread overview]
Message-ID: <1461017871-5395-1-git-send-email-colin.king@canonical.com> (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
reply other threads:[~2016-04-18 22:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1461017871-5395-1-git-send-email-colin.king@canonical.com \
--to=colin.king@canonical.com \
--cc=devel@acpica.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lv.zheng@intel.com \
--cc=rafael.j.wysocki@intel.com \
--cc=robert.moore@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).