Source-Changes-HG archive

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

[src/trunk]: src/distrib/utils/sysinst Make all curses/$TERM related failures...



details:   https://anonhg.NetBSD.org/src/rev/b5d631a10f96
branches:  trunk
changeset: 763967:b5d631a10f96
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Apr 08 15:53:44 2011 +0000

description:
Make all curses/$TERM related failures exit with error code 4 (everything
else in here only exits successfully or with error 1), so we can react
accordingly in the surrounding script. Part of fixing PR 44738.

diffstat:

 distrib/utils/sysinst/main.c   |  6 +++---
 distrib/utils/sysinst/menus.mi |  8 ++++++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r 043d3e031430 -r b5d631a10f96 distrib/utils/sysinst/main.c
--- a/distrib/utils/sysinst/main.c      Fri Apr 08 15:49:37 2011 +0000
+++ b/distrib/utils/sysinst/main.c      Fri Apr 08 15:53:44 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.58 2011/04/04 08:30:12 mbalmer Exp $        */
+/*     $NetBSD: main.c,v 1.59 2011/04/08 15:53:44 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -137,7 +137,7 @@
        if (!getenv("TERM")) {
                (void)fprintf(stderr,
                         "sysinst: environment variable TERM not set.\n");
-               exit(1);
+               exit(4);
        }
 
        /* argv processing */
@@ -164,7 +164,7 @@
        /* initialize message window */
        if (menu_init()) {
                __menu_initerror();
-               exit(1);
+               exit(4);
        }
 
        /*
diff -r 043d3e031430 -r b5d631a10f96 distrib/utils/sysinst/menus.mi
--- a/distrib/utils/sysinst/menus.mi    Fri Apr 08 15:49:37 2011 +0000
+++ b/distrib/utils/sysinst/menus.mi    Fri Apr 08 15:53:44 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: menus.mi,v 1.40 2011/02/01 01:42:07 joerg Exp $        */
+/*     $NetBSD: menus.mi,v 1.41 2011/04/08 15:53:44 martin Exp $       */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -65,7 +65,11 @@
 
 allow dynamic menus;
 allow dynamic messages;
-
+error action {
+       fprintf (stderr, "Could not initialize menu system, please check "
+           "your terminal type.\n");
+       exit(4);
+};
 
 menu selfskind, title MSG_Select_the_type, exitstring MSG_unchanged, y=6, x=30;
        display action {



Home | Main Index | Thread Index | Old Index