summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2003-06-02 03:46:42 +0000
committermillert <millert@openbsd.org>2003-06-02 03:46:42 +0000
commit3ec87a8a56c0f9cde775eba79cf53043719219fc (patch)
treeda7de6ea772a9e9237957d259a3e122d756d0e97 /lib/libc
parentprevents systrace from referencing freed memory; provos (diff)
downloadwireguard-openbsd-3ec87a8a56c0f9cde775eba79cf53043719219fc.tar.xz
wireguard-openbsd-3ec87a8a56c0f9cde775eba79cf53043719219fc.zip
Use the getopt() in getopt_long.c which supports some GNU extensions.
getopt.c is no longer compiled and will eventually be removed.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdlib/Makefile.inc2
-rw-r--r--lib/libc/stdlib/getopt_long.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.inc
index bfbbdcb7f43..b3be1f7bc2a 100644
--- a/lib/libc/stdlib/Makefile.inc
+++ b/lib/libc/stdlib/Makefile.inc
@@ -4,7 +4,7 @@
.PATH: ${LIBCSRCDIR}/arch/${MACHINE_ARCH}/stdlib ${LIBCSRCDIR}/stdlib
SRCS+= a64l.c abort.c atexit.c atoi.c atof.c atol.c atoll.c bsearch.c \
- calloc.c cfree.c exit.c ecvt.c gcvt.c getenv.c getopt.c getopt_long.c \
+ calloc.c cfree.c exit.c ecvt.c gcvt.c getenv.c getopt_long.c \
getsubopt.c heapsort.c l64a.c lsearch.c malloc.c merge.c \
multibyte.c putenv.c qsort.c radixsort.c rand.c random.c realpath.c \
setenv.c strtod.c strtol.c strtoll.c strtoul.c strtoull.c system.c \
diff --git a/lib/libc/stdlib/getopt_long.c b/lib/libc/stdlib/getopt_long.c
index 0cdc4d652f0..340065e3a08 100644
--- a/lib/libc/stdlib/getopt_long.c
+++ b/lib/libc/stdlib/getopt_long.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getopt_long.c,v 1.11 2002/12/10 17:51:42 millert Exp $ */
+/* $OpenBSD: getopt_long.c,v 1.12 2003/06/02 03:46:43 millert Exp $ */
/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */
/*
@@ -64,7 +64,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: getopt_long.c,v 1.11 2002/12/10 17:51:42 millert Exp $";
+static char *rcsid = "$OpenBSD: getopt_long.c,v 1.12 2003/06/02 03:46:43 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <err.h>
@@ -73,6 +73,8 @@ static char *rcsid = "$OpenBSD: getopt_long.c,v 1.11 2002/12/10 17:51:42 millert
#include <stdlib.h>
#include <string.h>
+#define REPLACE_GETOPT /* use this getopt as the system getopt(3) */
+
#ifdef REPLACE_GETOPT
int opterr = 1; /* if error message should be printed */
int optind = 1; /* index into parent argv vector */