summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-09-17 09:51:25 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-09-17 09:51:25 +0200
commit522778cda11f7f6fccfe6dbd5010364e282df1c2 (patch)
treee1943e99111d591d1a15f81987f541dc8a89c191 /tools
parent4c4cdc4c63853fee48c02e25c8605fb65a6c9924 (diff)
parent71bb4d9a4085ec6e2a90ca62c6afcafb945b55aa (diff)
downloadlinux-522778cda11f7f6fccfe6dbd5010364e282df1c2.tar.bz2
Merge branch 'acpica'
* acpica: ACPICA: Update version to 20190816. ACPICA: Add "Windows 2019" string to _OSI support. ACPICA: Differentiate Windows 8.1 from Windows 8. ACPICA: Fully deploy ACPI_PRINTF_LIKE macro ACPICA: iASL,acpi_dump: Improve y/n query ACPICA: Fix issues with arg types within printf format strings ACPICA: Macros: remove pointer math on a null pointer ACPICA: Increase total number of possible Owner IDs ACPICA: Debugger: remove redundant assignment on obj_desc
Diffstat (limited to 'tools')
-rw-r--r--tools/power/acpi/tools/acpidump/apfiles.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/power/acpi/tools/acpidump/apfiles.c b/tools/power/acpi/tools/acpidump/apfiles.c
index a42cfcaa3293..16d919bd133b 100644
--- a/tools/power/acpi/tools/acpidump/apfiles.c
+++ b/tools/power/acpi/tools/acpidump/apfiles.c
@@ -29,18 +29,24 @@ static int ap_is_existing_file(char *pathname)
{
#if !defined(_GNU_EFI) && !defined(_EDK2_EFI)
struct stat stat_info;
+ int in_char;
if (!stat(pathname, &stat_info)) {
fprintf(stderr,
"Target path already exists, overwrite? [y|n] ");
- if (getchar() != 'y') {
+ in_char = fgetc(stdin);
+ if (in_char == '\n') {
+ in_char = fgetc(stdin);
+ }
+
+ if (in_char != 'y' && in_char != 'Y') {
return (-1);
}
}
#endif
- return 0;
+ return (0);
}
/******************************************************************************