aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 87b9412b3..ffc4685d6 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -133,7 +133,7 @@ typedef enum {
133 133
134/* The descrip member of this structure is only used to make debugging 134/* The descrip member of this structure is only used to make debugging
135 * output pretty */ 135 * output pretty */
136static struct {int mode; int default_fd; char *descrip;} redir_table[] = { 136static const struct {int mode; int default_fd; const char *descrip;} redir_table[] = {
137 { 0, 0, "()" }, 137 { 0, 0, "()" },
138 { O_RDONLY, 0, "<" }, 138 { O_RDONLY, 0, "<" },
139 { O_CREAT|O_TRUNC|O_WRONLY, 1, ">" }, 139 { O_CREAT|O_TRUNC|O_WRONLY, 1, ">" },
@@ -297,8 +297,8 @@ struct in_str {
297#define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n" 297#define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n"
298 298
299struct built_in_command { 299struct built_in_command {
300 char *cmd; /* name */ 300 const char *cmd; /* name */
301 char *descr; /* description */ 301 const char *descr; /* description */
302 int (*function) (struct child_prog *); /* function ptr */ 302 int (*function) (struct child_prog *); /* function ptr */
303}; 303};
304 304
@@ -414,7 +414,7 @@ static int set_local_var(const char *s, int flg_export);
414 * in the parent shell process. If forked, of course they can not. 414 * in the parent shell process. If forked, of course they can not.
415 * For example, 'unset foo | whatever' will parse and run, but foo will 415 * For example, 'unset foo | whatever' will parse and run, but foo will
416 * still be set at the end. */ 416 * still be set at the end. */
417static struct built_in_command bltins[] = { 417static const struct built_in_command bltins[] = {
418 {"bg", "Resume a job in the background", builtin_fg_bg}, 418 {"bg", "Resume a job in the background", builtin_fg_bg},
419 {"break", "Exit for, while or until loop", builtin_not_written}, 419 {"break", "Exit for, while or until loop", builtin_not_written},
420 {"cd", "Change working directory", builtin_cd}, 420 {"cd", "Change working directory", builtin_cd},
@@ -618,7 +618,7 @@ static int builtin_fg_bg(struct child_prog *child)
618/* built-in 'help' handler */ 618/* built-in 'help' handler */
619static int builtin_help(struct child_prog *dummy) 619static int builtin_help(struct child_prog *dummy)
620{ 620{
621 struct built_in_command *x; 621 const struct built_in_command *x;
622 622
623 printf("\nBuilt-in commands:\n"); 623 printf("\nBuilt-in commands:\n");
624 printf("-------------------\n"); 624 printf("-------------------\n");
@@ -1076,7 +1076,7 @@ static void pseudo_exec(struct child_prog *child)
1076{ 1076{
1077 int i, rcode; 1077 int i, rcode;
1078 char *p; 1078 char *p;
1079 struct built_in_command *x; 1079 const struct built_in_command *x;
1080 if (child->argv) { 1080 if (child->argv) {
1081 for (i=0; is_assignment(child->argv[i]); i++) { 1081 for (i=0; is_assignment(child->argv[i]); i++) {
1082 debug_printf("pid %d environment modification: %s\n",getpid(),child->argv[i]); 1082 debug_printf("pid %d environment modification: %s\n",getpid(),child->argv[i]);
@@ -1338,7 +1338,7 @@ static int run_pipe_real(struct pipe *pi)
1338 int nextin, nextout; 1338 int nextin, nextout;
1339 int pipefds[2]; /* pipefds[0] is for reading */ 1339 int pipefds[2]; /* pipefds[0] is for reading */
1340 struct child_prog *child; 1340 struct child_prog *child;
1341 struct built_in_command *x; 1341 const struct built_in_command *x;
1342 char *p; 1342 char *p;
1343 1343
1344 nextin = 0; 1344 nextin = 0;