Skip to contentSkip to conversation

kbuild: use getopt_long(), not its _only() variant

RFC In review Arnaud Lacombe 3 participants 4 messages Aug 23, 2010 – Aug 31, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 kbuild: use getopt_long(), not its _only() variant

NetBSD lacks getopt_long_only() whereas getopt_long() works just fine.

---
 scripts/kconfig/conf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/kconfig/conf.c +1 -1
index 5b7c86e..ecb16c0 100644
@@ -466,7 +466,7 @@ int main(int ac, char **av)
 	bindtextdomain(PACKAGE, LOCALEDIR);
 	textdomain(PACKAGE);
 
-	while ((opt = getopt_long_only(ac, av, "", long_opts, NULL)) != -1) {
+	while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) {
 		input_mode = (enum input_mode)opt;
 		switch (opt) {
 		case silentoldconfig:
Signature · 1 line
1.7.2.30.gc37d7.dirty
#1 lore raw
Quoted 12 lines · Arnaud Lacombe

NetBSD lacks getopt_long_only() whereas getopt_long() works just fine.

---
 scripts/kconfig/conf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/kconfig/conf.c +0 -0
index 5b7c86e..ecb16c0 100644

scripts/kconfig/conf.c int main(int ac, char **av) · line 472

Quoted 8 lines
scripts/kconfig/conf.c +1 -1
@@ -466,7 +466,7 @@ int main(int ac, char **av)
 	bindtextdomain(PACKAGE, LOCALEDIR);
 	textdomain(PACKAGE);
 
-	while ((opt = getopt_long_only(ac, av, "", long_opts, NULL)) != -1) {
+	while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) {
 		input_mode = (enum input_mode)opt;
 		switch (opt) {
 		case silentoldconfig:

scripts/kconfig/Makefile uses the two-dash notation, so getopt_long_only() really isn't necessary. Applied to kbuild-2.6.git#kconfig.

Michal

#2 lore raw
Quoted 16 lines · Michal Marek
Quoted 15 lines · Arnaud Lacombe

NetBSD lacks getopt_long_only() whereas getopt_long() works just fine.

---
 scripts/kconfig/conf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/kconfig/conf.c +0 -0
index 5b7c86e..ecb16c0 100644
@@ -466,7 +466,7 @@ int main(int ac, char **av)
 	bindtextdomain(PACKAGE, LOCALEDIR);
 	textdomain(PACKAGE);
 
Quoted 9 lines

scripts/kconfig/conf.c int main(int ac, char **av) · line 472

Quoted 5 lines
scripts/kconfig/conf.c +1 -1
-	while ((opt = getopt_long_only(ac, av, "", long_opts, NULL)) != -1) {
+	while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) {
 		input_mode = (enum input_mode)opt;
 		switch (opt) {
 		case silentoldconfig:

scripts/kconfig/Makefile uses the two-dash notation, so getopt_long_only() really isn't necessary. Applied to kbuild-2.6.git#kconfig.

Seems I forgot to do so - I had meant to ack this patch.

Thanks,
Sam

#3 lore raw
Quoted 5 lines · Sam Ravnborg
Quoted 4 lines · Michal Marek
Quoted 3 lines · Arnaud Lacombe

NetBSD lacks getopt_long_only() whereas getopt_long() works just fine.

...

Quoted 1 line

Seems I forgot to do so - I had meant to ack this patch.

I haven't pushed it yet, so I did a git commit --amend and added your ACK.

Michal