summaryrefslogtreecommitdiff
path: root/openbsd-compat/getopt_long.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2013-05-10 16:28:55 +1000
committerDarren Tucker <dtucker@zip.com.au>2013-05-10 16:28:55 +1000
commitccfdfceacb7e23d1479ed4cc91976c5ac6e23c56 (patch)
tree5d25c5c77c2143c09413e8b3483f5133aebaa5b8 /openbsd-compat/getopt_long.c
parent39332020078aa8fd4fc28e00b336438dc64b0f5a (diff)
- (dtucker) [openbsd-compat/Makefile.in openbsd-compat/getopt.c
openbsd-compat/getopt_long.c regress/modpipe.c] Remove getopt.c, add portability code to getopt_long.c and switch over Makefile and the ugly hack in modpipe.c. Fixes bz#1448.
Diffstat (limited to 'openbsd-compat/getopt_long.c')
-rw-r--r--openbsd-compat/getopt_long.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/openbsd-compat/getopt_long.c b/openbsd-compat/getopt_long.c
index e149fe0ac..6b36d0672 100644
--- a/openbsd-compat/getopt_long.c
+++ b/openbsd-compat/getopt_long.c
@@ -49,7 +49,22 @@
49 * POSSIBILITY OF SUCH DAMAGE. 49 * POSSIBILITY OF SUCH DAMAGE.
50 */ 50 */
51 51
52/* OPENBSD ORIGINAL: lib/libc/stdlib/getopt_long.c */
53#include "includes.h"
54
55#if !defined(HAVE_GETOPT) || !defined(HAVE_GETOPT_OPTRESET)
56#include "log.h"
57
58/*
59 * Some defines to make it easier to keep the code in sync with upstream.
60 * getopt opterr optind optopt optreset optarg are all in defines.h which is
61 * pulled in by includes.h.
62 */
63#define warnx logit
64
65#if 0
52#include <err.h> 66#include <err.h>
67#endif
53#include <errno.h> 68#include <errno.h>
54#include <getopt.h> 69#include <getopt.h>
55#include <stdlib.h> 70#include <stdlib.h>
@@ -484,6 +499,7 @@ getopt(int nargc, char * const *nargv, const char *options)
484 return (getopt_internal(nargc, nargv, options, NULL, NULL, 0)); 499 return (getopt_internal(nargc, nargv, options, NULL, NULL, 0));
485} 500}
486 501
502#if 0
487/* 503/*
488 * getopt_long -- 504 * getopt_long --
489 * Parse argc/argv argument vector. 505 * Parse argc/argv argument vector.
@@ -509,3 +525,6 @@ getopt_long_only(int nargc, char * const *nargv, const char *options,
509 return (getopt_internal(nargc, nargv, options, long_options, idx, 525 return (getopt_internal(nargc, nargv, options, long_options, idx,
510 FLAG_PERMUTE|FLAG_LONGONLY)); 526 FLAG_PERMUTE|FLAG_LONGONLY));
511} 527}
528#endif
529
530#endif /* !defined(HAVE_GETOPT) || !defined(HAVE_OPTRESET) */