summaryrefslogtreecommitdiff
path: root/boot/boot.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-09-23 06:27:39 +0000
committerRoland McGrath <roland@gnu.org>1995-09-23 06:27:39 +0000
commit8b20f78a4fe6c446d6fed1b2874cea40bba521cc (patch)
tree383c72e2c43f04873a73bb73cd64ba8b09c755ba /boot/boot.c
parentd7a263f65eba5ac28c98f42f66f9b6e1c88c448a (diff)
(main): Use static const for constant strings.
On boot script error, write script line with error msg.
Diffstat (limited to 'boot/boot.c')
-rw-r--r--boot/boot.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/boot/boot.c b/boot/boot.c
index 70a6d9c6..cf89e65a 100644
--- a/boot/boot.c
+++ b/boot/boot.c
@@ -530,7 +530,7 @@ int
main (int argc, char **argv, char **envp)
{
mach_port_t foo;
- char usagemsg[] = "Usage: boot [SWITCHES] SCRIPT ROOT-DEVICE\n";
+ static const char usagemsg[] = "Usage: boot [SWITCHES] SCRIPT ROOT-DEVICE\n";
char *buf = 0;
char *bootscript;
int i, len;
@@ -595,7 +595,7 @@ main (int argc, char **argv, char **envp)
|| boot_script_set_variable ("root-device", VAL_STR, (int) bootdevice)
|| boot_script_set_variable ("boot-args", VAL_STR, (int) bootstrap_args))
{
- char msg[] = "error setting variable";
+ static const char msg[] = "error setting variable";
write (2, msg, strlen (msg));
uxexit (1);
@@ -604,7 +604,7 @@ main (int argc, char **argv, char **envp)
/* Parse the boot script. */
{
char *p, *line;
- char filemsg[] = "Can't open boot script";
+ static const char filemsg[] = "Can't open boot script";
int amt, fd, err;
fd = open (bootscript, 0, 0);
@@ -648,6 +648,9 @@ main (int argc, char **argv, char **envp)
str = boot_script_error_string (err);
i = strlen (str);
write (2, str, i);
+ write (2, " in `", 5);
+ write (2, line, strlen (line));
+ write (2, "'\n", 2);
uxexit (1);
}
if (p == buf + amt)
@@ -658,7 +661,7 @@ main (int argc, char **argv, char **envp)
if (index (bootstrap_args, 'd'))
{
- char msg[] = "Pausing. . .";
+ static const char msg[] = "Pausing. . .";
char c;
write (2, msg, sizeof (msg) - 1);
read (0, &c, 1);