summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2016-05-23 23:06:54 +0800
committerLv Zheng <lv.zheng@intel.com>2016-06-06 12:58:29 +0800
commit33f019a5bf9901048822f7cc1701603d4087cf99 (patch)
tree8347da773d0564bb8f1b973e976c2c2c7e2f59c3
parentfe92a821a09e91035b27c30cfdaf8e54d846594f (diff)
downloadacpica-33f019a5bf9901048822f7cc1701603d4087cf99.tar.gz
Applications: Fix a potential issue that help messages may be dumped to AcpiGbl_DebugFile
There is an issue for usage macros, if an command line option changed AcpiGbl_DebugFile, then the follow up usage may errornously dumped to the debug file. This is just a bug in theory, because currently AcpiGbl_DebugFile can only be modified by acpibin and acpiexec. Currently this will not trigger such issue because: 1. For acpibin, AcpiGbl_DebugFile will be modified by "-t" option and the program exit after processing this option without dumping help message or other error options. 2. For acpiexec, AcpiGbl_DebugFile will only be modified by the open command, which happens after parsing the command line options, so no help message will be dumped into the debug file. But maintaining this logic is difficult, so this patch modifies AcpiOsPrintf() into printf() for usage macros so that the help messages are ensured to be dumped to the stdout. Lv Zheng. Signed-off-by: Lv Zheng <lv.zheng@intel.com>
-rw-r--r--source/include/acapps.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/include/acapps.h b/source/include/acapps.h
index 8699dcbba..f8b7bd0b3 100644
--- a/source/include/acapps.h
+++ b/source/include/acapps.h
@@ -151,13 +151,13 @@
/* Macros for usage messages */
#define ACPI_USAGE_HEADER(Usage) \
- AcpiOsPrintf ("Usage: %s\nOptions:\n", Usage);
+ printf ("Usage: %s\nOptions:\n", Usage);
#define ACPI_USAGE_TEXT(Description) \
- AcpiOsPrintf (Description);
+ printf (Description);
#define ACPI_OPTION(Name, Description) \
- AcpiOsPrintf (" %-20s%s\n", Name, Description);
+ printf (" %-20s%s\n", Name, Description);
/* Check for unexpected exceptions */