summaryrefslogtreecommitdiff
path: root/source/common/getopt.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/common/getopt.c')
-rw-r--r--source/common/getopt.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source/common/getopt.c b/source/common/getopt.c
index bca9a6f3e7f4..5ae1e0aa4358 100644
--- a/source/common/getopt.c
+++ b/source/common/getopt.c
@@ -51,14 +51,12 @@
* "f|" - Option has required single-char sub-options
*/
-#include <stdio.h>
-#include <string.h>
#include "acpi.h"
#include "accommon.h"
#include "acapps.h"
#define ACPI_OPTION_ERROR(msg, badchar) \
- if (AcpiGbl_Opterr) {fprintf (stderr, "%s%c\n", msg, badchar);}
+ if (AcpiGbl_Opterr) {AcpiLogError ("%s%c\n", msg, badchar);}
int AcpiGbl_Opterr = 1;
@@ -123,7 +121,7 @@ AcpiGetoptArgument (
* PARAMETERS: argc, argv - from main
* opts - options info list
*
- * RETURN: Option character or EOF
+ * RETURN: Option character or ACPI_OPT_END
*
* DESCRIPTION: Get the next option
*
@@ -145,12 +143,12 @@ AcpiGetopt(
argv[AcpiGbl_Optind][0] != '-' ||
argv[AcpiGbl_Optind][1] == '\0')
{
- return (EOF);
+ return (ACPI_OPT_END);
}
- else if (strcmp (argv[AcpiGbl_Optind], "--") == 0)
+ else if (ACPI_STRCMP (argv[AcpiGbl_Optind], "--") == 0)
{
AcpiGbl_Optind++;
- return (EOF);
+ return (ACPI_OPT_END);
}
}
@@ -161,7 +159,7 @@ AcpiGetopt(
/* Make sure that the option is legal */
if (CurrentChar == ':' ||
- (OptsPtr = strchr (opts, CurrentChar)) == NULL)
+ (OptsPtr = ACPI_STRCHR (opts, CurrentChar)) == NULL)
{
ACPI_OPTION_ERROR ("Illegal option: -", CurrentChar);