summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authormartin <martin@NetBSD.org>2019-06-23 11:22:48 +0000
committermartin <martin@NetBSD.org>2019-06-23 11:22:48 +0000
commitc016e440cb97571590a96ca2df6bba52bb8d5863 (patch)
tree6407fb530ef71d2439beac4cfb91a7d054c64f4a /usr.bin
parentf00d8fca53d7290b04cf280f129da36744806525 (diff)
Use OPT_NOMENU as error return for new_menu (instead of old hard coded -1).
Update man page for the OPT_NOMENU change.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/menuc/menu_sys.def6
-rw-r--r--usr.bin/menuc/menuc.14
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/menuc/menu_sys.def b/usr.bin/menuc/menu_sys.def
index f9cfe246ef4..318082ee576 100644
--- a/usr.bin/menuc/menu_sys.def
+++ b/usr.bin/menuc/menu_sys.def
@@ -1,4 +1,4 @@
-/* $NetBSD: menu_sys.def,v 1.70 2019/06/22 20:44:54 christos Exp $ */
+/* $NetBSD: menu_sys.def,v 1.71 2019/06/23 11:22:48 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -859,12 +859,12 @@ new_menu(const char *title, menu_ent *opts, int numopts,
/* Find free menu entry. */
for (ix = DYN_MENU_START; ; ix++) {
if (ix >= num_menus && !double_menus())
- return -1;
+ return OPT_NOMENU;
m = menu_list[ix];
if (m == NULL) {
m = calloc(sizeof *m, 1);
if (m == NULL)
- return -1;
+ return OPT_NOMENU;
menu_list[ix] = m;
break;
}
diff --git a/usr.bin/menuc/menuc.1 b/usr.bin/menuc/menuc.1
index cfc042391b8..51dfcdf49b1 100644
--- a/usr.bin/menuc/menuc.1
+++ b/usr.bin/menuc/menuc.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: menuc.1,v 1.37 2019/02/25 20:47:37 martin Exp $
+.\" $NetBSD: menuc.1,v 1.38 2019/06/23 11:22:48 martin Exp $
.\"
.\" Copyright 1997 Piermont Information Systems Inc.
.\" All rights reserved.
@@ -424,7 +424,7 @@ struct menu_ent {
} menu_ent ;
/* For opt_menu */
-#define OPT_NOMENU -1
+#define OPT_NOMENU 0
/* For opt_flags */
#define OPT_SUB 1