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.
This commit is contained in:
cgd 1999-07-04 21:39:33 +00:00
parent 1904092f06
commit c624190287
3 changed files with 9 additions and 9 deletions

View File

@ -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 @@ void mnt_net_config __P((void));
/* 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 *));

View File

@ -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 @@ int write_disklabel (void)
#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 @@ do_ffs_newfs(const char *partname, int partno, const char *mountpoint)
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);

View File

@ -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 @@ loop:
*/
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 @@ run_prog(int fatal, int display, const char *errmsg, const char *cmd, ...)
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);