Commit 911a9b84 authored by Lv Zheng's avatar Lv Zheng Committed by Rafael J. Wysocki

ACPICA: Applications: Fix a potential issue that help messages may be dumped to acpi_gbl_debug_file

ACPICA commit d1b7372c7eb89cdba3d3c239fb07e2fdc5abf880

This is a regression fix, restoring usage macro to its original
implementation.

There is an issue for usage macros, if an command line option changed
acpi_gbl_debug_file, then the follow up usage message may be errornously
dumped to the debug file.
This is just a bug in theory, because currently acpi_gbl_debug_file can only
be modified by acpibin and acpiexec. And this will not trigger such issue
because:
1. For acpibin, acpi_gbl_debug_file will be modified by "-t" option and the
   program exits after processing this option without dumping help message
   or other error options.
2. For acpiexec, acpi_gbl_debug_file 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
acpi_os_printf() into printf() for usage macros so that the help messages are
ensured to be dumped to the stdout. Lv Zheng.

Link: https://github.com/acpica/acpica/commit/d1b7372c
Link: https://bugs.acpica.org/show_bug.cgi?id=1142Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent dd99cbcc
......@@ -83,13 +83,13 @@
/* Macros for usage messages */
#define ACPI_USAGE_HEADER(usage) \
acpi_os_printf ("Usage: %s\nOptions:\n", usage);
printf ("Usage: %s\nOptions:\n", usage);
#define ACPI_USAGE_TEXT(description) \
acpi_os_printf (description);
printf (description);
#define ACPI_OPTION(name, description) \
acpi_os_printf (" %-20s%s\n", name, description);
printf (" %-20s%s\n", name, description);
/* Check for unexpected exceptions */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment