Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/gpt Make gpt(8) work when compiled on a glibc-based OS.



details:   https://anonhg.NetBSD.org/src/rev/e5eefe97230e
branches:  trunk
changeset: 821664:e5eefe97230e
user:      aymeric <aymeric%NetBSD.org@localhost>
date:      Sun Feb 12 16:54:06 2017 +0000

description:
Make gpt(8) work when compiled on a glibc-based OS.

This restores the ability to build amd64 install-image's under Linux.

diffstat:

 sbin/gpt/main.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r be52c992689e -r e5eefe97230e sbin/gpt/main.c
--- a/sbin/gpt/main.c   Sun Feb 12 16:18:48 2017 +0000
+++ b/sbin/gpt/main.c   Sun Feb 12 16:54:06 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.7 2015/12/29 16:45:04 christos Exp $        */
+/*     $NetBSD: main.c,v 1.8 2017/02/12 16:54:06 aymeric Exp $ */
 
 /*-
  * Copyright (c) 2002 Marcel Moolenaar
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 #ifdef __RCSID
-__RCSID("$NetBSD: main.c,v 1.7 2015/12/29 16:45:04 christos Exp $");
+__RCSID("$NetBSD: main.c,v 1.8 2017/02/12 16:54:06 aymeric Exp $");
 #endif
 
 #include <stdio.h>
@@ -145,8 +145,14 @@
                dev = argv[--argc];
        }
 
+#ifdef __GLIBC__
+#define GETOPT_BE_POSIX                "+"
+#else
+#define GETOPT_BE_POSIX                ""
+#endif
+
        /* Get the generic options */
-       while ((ch = getopt(argc, argv, "m:nqrs:v")) != -1) {
+       while ((ch = getopt(argc, argv, GETOPT_BE_POSIX "m:nqrs:v")) != -1) {
                switch(ch) {
                case 'm':
                        if (mediasz > 0)



Home | Main Index | Thread Index | Old Index