Source-Changes-HG archive

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

[src/trunk]: src/distrib/utils/sysinst convert run_prog's error message from ...



details:   https://anonhg.NetBSD.org/src/rev/cbc530d773e0
branches:  trunk
changeset: 474381:cbc530d773e0
user:      cgd <cgd%NetBSD.org@localhost>
date:      Sun Jul 04 21:39:33 1999 +0000

description:
convert run_prog's error message from being a "const char *" to a msg.
XXX Only the callers that actually pass strings were fixed, the rest were
XXX left passing 'NULL'.  Eventually they should be cleaned up to pass
XXX MSG_NONE, but I didn't want to do that yet because somebody else
XXX (jonathan) is hacking on the run_prog callers and I didn't want to
XXX cause him a Lot of conflicts.  at least right now, MSG_NONE and NULL
XXX are as equivalent as they need to be.

diffstat:

 distrib/utils/sysinst/defs.h  |  4 ++--
 distrib/utils/sysinst/disks.c |  6 +++---
 distrib/utils/sysinst/run.c   |  8 ++++----
 3 files changed, 9 insertions(+), 9 deletions(-)

diffs (74 lines):

diff -r 9e15243db72d -r cbc530d773e0 distrib/utils/sysinst/defs.h
--- a/distrib/utils/sysinst/defs.h      Sun Jul 04 21:32:48 1999 +0000
+++ b/distrib/utils/sysinst/defs.h      Sun Jul 04 21:39:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: defs.h,v 1.46 1999/07/04 21:32:48 cgd Exp $    */
+/*     $NetBSD: defs.h,v 1.47 1999/07/04 21:39:33 cgd Exp $    */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -274,7 +274,7 @@
 
 /* From run.c */
 int    collect __P((int kind, char **buffer, const char *name, ...));
-int    run_prog __P((int, int, const char *, const char *, ...));
+int    run_prog __P((int, int, msg, const char *, ...));
 void   do_logging __P((void));
 int    do_system __P((const char *));
 
diff -r 9e15243db72d -r cbc530d773e0 distrib/utils/sysinst/disks.c
--- a/distrib/utils/sysinst/disks.c     Sun Jul 04 21:32:48 1999 +0000
+++ b/distrib/utils/sysinst/disks.c     Sun Jul 04 21:39:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disks.c,v 1.28 1999/07/04 08:01:39 cgd Exp $ */
+/*     $NetBSD: disks.c,v 1.29 1999/07/04 21:39:33 cgd Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -232,7 +232,7 @@
 
 #ifdef DISKLABEL_CMD
        /* disklabel the disk */
-       return run_prog(0, 1, msg_string(MSG_cmdfail),
+       return run_prog(0, 1, MSG_cmdfail,
            "%s %s %s", DISKLABEL_CMD, diskdev, bsddiskname);
 #endif
        return 0;
@@ -271,7 +271,7 @@
        char devname[STRSIZE];
        int error;
 
-       error = run_prog(0, 1, msg_string(MSG_cmdfail), 
+       error = run_prog(0, 1, MSG_cmdfail,
            "/sbin/newfs /dev/r%s", partname);
        if (*mountpoint && error == 0) { 
                snprintf(devname, STRSIZE, "/dev/%s", partname);
diff -r 9e15243db72d -r cbc530d773e0 distrib/utils/sysinst/run.c
--- a/distrib/utils/sysinst/run.c       Sun Jul 04 21:32:48 1999 +0000
+++ b/distrib/utils/sysinst/run.c       Sun Jul 04 21:39:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: run.c,v 1.22 1999/07/04 21:32:48 cgd Exp $     */
+/*     $NetBSD: run.c,v 1.23 1999/07/04 21:39:34 cgd Exp $     */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -419,7 +419,7 @@
  */
 
 int
-run_prog(int fatal, int display, const char *errmsg, const char *cmd, ...)
+run_prog(int fatal, int display, msg errmsg, const char *cmd, ...)
 {
        va_list ap;
        struct winsize win;
@@ -530,8 +530,8 @@
        va_end(ap);
        if (fatal && ret != 0)
                exit(ret);
-       if (ret && errmsg) {
-               msg_printf(errmsg, command);
+       if (ret && errmsg != MSG_NONE) {
+               msg_display(errmsg, command);
                process_menu(MENU_ok);
        }
        return(ret);



Home | Main Index | Thread Index | Old Index