diff options
Diffstat (limited to 'tools/power/acpi')
-rw-r--r-- | tools/power/acpi/common/getopt.c | 1 | ||||
-rw-r--r-- | tools/power/acpi/os_specific/service_layers/oslibcfs.c | 3 | ||||
-rw-r--r-- | tools/power/acpi/tools/acpidump/apfiles.c | 13 |
3 files changed, 17 insertions, 0 deletions
diff --git a/tools/power/acpi/common/getopt.c b/tools/power/acpi/common/getopt.c index 326e826a5d20..24966290ad1c 100644 --- a/tools/power/acpi/common/getopt.c +++ b/tools/power/acpi/common/getopt.c @@ -85,6 +85,7 @@ static int current_char_ptr = 1; int acpi_getopt_argument(int argc, char **argv) { + acpi_gbl_optind--; current_char_ptr++; diff --git a/tools/power/acpi/os_specific/service_layers/oslibcfs.c b/tools/power/acpi/os_specific/service_layers/oslibcfs.c index b51e40a9a120..6df758302604 100644 --- a/tools/power/acpi/os_specific/service_layers/oslibcfs.c +++ b/tools/power/acpi/os_specific/service_layers/oslibcfs.c @@ -73,6 +73,7 @@ ACPI_FILE acpi_os_open_file(const char *path, u8 modes) if (modes & ACPI_FILE_WRITING) { modes_str[i++] = 'w'; } + if (modes & ACPI_FILE_BINARY) { modes_str[i++] = 'b'; } @@ -101,6 +102,7 @@ ACPI_FILE acpi_os_open_file(const char *path, u8 modes) void acpi_os_close_file(ACPI_FILE file) { + fclose(file); } @@ -202,6 +204,7 @@ acpi_status acpi_os_set_file_offset(ACPI_FILE file, long offset, u8 from) if (from == ACPI_FILE_BEGIN) { ret = fseek(file, offset, SEEK_SET); } + if (from == ACPI_FILE_END) { ret = fseek(file, offset, SEEK_END); } diff --git a/tools/power/acpi/tools/acpidump/apfiles.c b/tools/power/acpi/tools/acpidump/apfiles.c index a1c62de42a3b..bbdf9e8e25bc 100644 --- a/tools/power/acpi/tools/acpidump/apfiles.c +++ b/tools/power/acpi/tools/acpidump/apfiles.c @@ -48,6 +48,18 @@ static int ap_is_existing_file(char *pathname); +/****************************************************************************** + * + * FUNCTION: ap_is_existing_file + * + * PARAMETERS: pathname - Output filename + * + * RETURN: 0 on success + * + * DESCRIPTION: Query for file overwrite if it already exists. + * + ******************************************************************************/ + static int ap_is_existing_file(char *pathname) { #ifndef _GNU_EFI @@ -136,6 +148,7 @@ int ap_write_to_binary_file(struct acpi_table_header *table, u32 instance) } else { ACPI_MOVE_NAME(filename, table->signature); } + filename[0] = (char)tolower((int)filename[0]); filename[1] = (char)tolower((int)filename[1]); filename[2] = (char)tolower((int)filename[2]); |