Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d2c8223 authored by Lv Zheng's avatar Lv Zheng Committed by Rafael J. Wysocki
Browse files

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: 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 846d6ef4
Loading
Loading
Loading
Loading
+23 −7
Original line number Original line Diff line number Diff line
@@ -44,6 +44,27 @@
#include "acpidump.h"
#include "acpidump.h"
#include "acapps.h"
#include "acapps.h"


/* Local prototypes */

static int ap_is_existing_file(char *pathname);

static int ap_is_existing_file(char *pathname)
{
#ifndef _GNU_EFI
	struct stat stat_info;

	if (!stat(pathname, &stat_info)) {
		acpi_log_error("Target path already exists, overwrite? [y|n] ");

		if (getchar() != 'y') {
			return (-1);
		}
	}
#endif

	return 0;
}

/******************************************************************************
/******************************************************************************
 *
 *
 * FUNCTION:    ap_open_output_file
 * FUNCTION:    ap_open_output_file
@@ -59,18 +80,13 @@


int ap_open_output_file(char *pathname)
int ap_open_output_file(char *pathname)
{
{
	struct stat stat_info;
	ACPI_FILE file;
	ACPI_FILE file;


	/* If file exists, prompt for overwrite */
	/* If file exists, prompt for overwrite */


	if (!stat(pathname, &stat_info)) {
	if (ap_is_existing_file(pathname) != 0) {
		acpi_log_error("Target path already exists, overwrite? [y|n] ");

		if (getchar() != 'y') {
		return (-1);
		return (-1);
	}
	}
	}


	/* Point stdout to the file */
	/* Point stdout to the file */


+4 −0
Original line number Original line Diff line number Diff line
@@ -291,7 +291,11 @@ static int ap_do_options(int argc, char **argv)
 *
 *
 ******************************************************************************/
 ******************************************************************************/


#ifndef _GNU_EFI
int ACPI_SYSTEM_XFACE main(int argc, char *argv[])
int ACPI_SYSTEM_XFACE main(int argc, char *argv[])
#else
int ACPI_SYSTEM_XFACE acpi_main(int argc, char *argv[])
#endif
{
{
	int status = 0;
	int status = 0;
	struct ap_dump_action *action;
	struct ap_dump_action *action;