diff options
| author | Lv Zheng <lv.zheng@intel.com> | 2014-07-07 22:07:59 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-07-08 08:22:27 -0400 |
| commit | 4d2c8223f5220bac2e81dce41fe67e913790ea51 (patch) | |
| tree | e9f7fb0064c2c39cdea83efef0c3f5b5ca2daf9e /tools | |
| parent | 846d6ef4d7f0fed114aa1284a245bb1aa96417df (diff) | |
ACPICA: OSL: Update acpidump to reduce source code differences
This patch is a result of an ACPICA commit to enables acpidump for EFI. For
Linux kernel, this patch is a no-op. It is only required by the ACPICA
release process to reduce the source code differences between the Linux
kernel and the ACPICA upstream. Lv Zheng.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/power/acpi/tools/acpidump/apfiles.c | 30 | ||||
| -rw-r--r-- | tools/power/acpi/tools/acpidump/apmain.c | 4 |
2 files changed, 27 insertions, 7 deletions
diff --git a/tools/power/acpi/tools/acpidump/apfiles.c b/tools/power/acpi/tools/acpidump/apfiles.c index 5781c13ae333..d470046a6d81 100644 --- a/tools/power/acpi/tools/acpidump/apfiles.c +++ b/tools/power/acpi/tools/acpidump/apfiles.c | |||
| @@ -44,6 +44,27 @@ | |||
| 44 | #include "acpidump.h" | 44 | #include "acpidump.h" |
| 45 | #include "acapps.h" | 45 | #include "acapps.h" |
| 46 | 46 | ||
| 47 | /* Local prototypes */ | ||
| 48 | |||
| 49 | static int ap_is_existing_file(char *pathname); | ||
| 50 | |||
| 51 | static int ap_is_existing_file(char *pathname) | ||
| 52 | { | ||
| 53 | #ifndef _GNU_EFI | ||
| 54 | struct stat stat_info; | ||
| 55 | |||
| 56 | if (!stat(pathname, &stat_info)) { | ||
| 57 | acpi_log_error("Target path already exists, overwrite? [y|n] "); | ||
| 58 | |||
| 59 | if (getchar() != 'y') { | ||
| 60 | return (-1); | ||
| 61 | } | ||
| 62 | } | ||
| 63 | #endif | ||
| 64 | |||
| 65 | return 0; | ||
| 66 | } | ||
| 67 | |||
| 47 | /****************************************************************************** | 68 | /****************************************************************************** |
| 48 | * | 69 | * |
| 49 | * FUNCTION: ap_open_output_file | 70 | * FUNCTION: ap_open_output_file |
| @@ -59,17 +80,12 @@ | |||
| 59 | 80 | ||
| 60 | int ap_open_output_file(char *pathname) | 81 | int ap_open_output_file(char *pathname) |
| 61 | { | 82 | { |
| 62 | struct stat stat_info; | ||
| 63 | ACPI_FILE file; | 83 | ACPI_FILE file; |
| 64 | 84 | ||
| 65 | /* If file exists, prompt for overwrite */ | 85 | /* If file exists, prompt for overwrite */ |
| 66 | 86 | ||
| 67 | if (!stat(pathname, &stat_info)) { | 87 | if (ap_is_existing_file(pathname) != 0) { |
| 68 | acpi_log_error("Target path already exists, overwrite? [y|n] "); | 88 | return (-1); |
| 69 | |||
| 70 | if (getchar() != 'y') { | ||
| 71 | return (-1); | ||
| 72 | } | ||
| 73 | } | 89 | } |
| 74 | 90 | ||
| 75 | /* Point stdout to the file */ | 91 | /* Point stdout to the file */ |
diff --git a/tools/power/acpi/tools/acpidump/apmain.c b/tools/power/acpi/tools/acpidump/apmain.c index 35bd6740306e..853b4da22c3e 100644 --- a/tools/power/acpi/tools/acpidump/apmain.c +++ b/tools/power/acpi/tools/acpidump/apmain.c | |||
| @@ -291,7 +291,11 @@ static int ap_do_options(int argc, char **argv) | |||
| 291 | * | 291 | * |
| 292 | ******************************************************************************/ | 292 | ******************************************************************************/ |
| 293 | 293 | ||
| 294 | #ifndef _GNU_EFI | ||
| 294 | int ACPI_SYSTEM_XFACE main(int argc, char *argv[]) | 295 | int ACPI_SYSTEM_XFACE main(int argc, char *argv[]) |
| 296 | #else | ||
| 297 | int ACPI_SYSTEM_XFACE acpi_main(int argc, char *argv[]) | ||
| 298 | #endif | ||
| 295 | { | 299 | { |
| 296 | int status = 0; | 300 | int status = 0; |
| 297 | struct ap_dump_action *action; | 301 | struct ap_dump_action *action; |
