aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-04-18 21:04:25 +0000
committerMike Frysinger <vapier@gentoo.org>2009-04-18 21:04:25 +0000
commit885b6f29ae2740399231427dc2c6efe47db9a80d (patch)
tree1fdf749b5f252e9d0a2dac5cd2db475714716fa5
parent6008d8a3cc80c1d758f99ed1229ca2b9bcd4c3b1 (diff)
downloadbusybox-w32-885b6f29ae2740399231427dc2c6efe47db9a80d.tar.gz
busybox-w32-885b6f29ae2740399231427dc2c6efe47db9a80d.tar.bz2
busybox-w32-885b6f29ae2740399231427dc2c6efe47db9a80d.zip
fix build errors when function support is turned off
-rw-r--r--shell/hush.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 56a289777..ecacd96ed 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2901,13 +2901,17 @@ static void exec_function(nommu_save_t *nommu_save,
2901static int run_function(const struct function *funcp, char **argv) 2901static int run_function(const struct function *funcp, char **argv)
2902{ 2902{
2903 int rc; 2903 int rc;
2904 smallint sv_flg;
2905 save_arg_t sv; 2904 save_arg_t sv;
2905#if ENABLE_HUSH_FUNCTIONS
2906 smallint sv_flg;
2907#endif
2906 2908
2907 save_and_replace_G_args(&sv, argv); 2909 save_and_replace_G_args(&sv, argv);
2910#if ENABLE_HUSH_FUNCTIONS
2908 /* "we are in function, ok to use return" */ 2911 /* "we are in function, ok to use return" */
2909 sv_flg = G.flag_return_in_progress; 2912 sv_flg = G.flag_return_in_progress;
2910 G.flag_return_in_progress = -1; 2913 G.flag_return_in_progress = -1;
2914#endif
2911 2915
2912 /* On MMU, funcp->body is always non-NULL */ 2916 /* On MMU, funcp->body is always non-NULL */
2913#if !BB_MMU 2917#if !BB_MMU
@@ -2921,7 +2925,9 @@ static int run_function(const struct function *funcp, char **argv)
2921 rc = run_list(funcp->body); 2925 rc = run_list(funcp->body);
2922 } 2926 }
2923 2927
2928#if ENABLE_HUSH_FUNCTIONS
2924 G.flag_return_in_progress = sv_flg; 2929 G.flag_return_in_progress = sv_flg;
2930#endif
2925 restore_G_args(&sv, argv); 2931 restore_G_args(&sv, argv);
2926 2932
2927 return rc; 2933 return rc;
@@ -6775,8 +6781,10 @@ static int builtin_shift(char **argv)
6775static int builtin_source(char **argv) 6781static int builtin_source(char **argv)
6776{ 6782{
6777 FILE *input; 6783 FILE *input;
6778 smallint sv_flg;
6779 save_arg_t sv; 6784 save_arg_t sv;
6785#if ENABLE_HUSH_FUNCTIONS
6786 smallint sv_flg;
6787#endif
6780 6788
6781 if (*++argv == NULL) 6789 if (*++argv == NULL)
6782 return EXIT_FAILURE; 6790 return EXIT_FAILURE;
@@ -6789,16 +6797,20 @@ static int builtin_source(char **argv)
6789 } 6797 }
6790 close_on_exec_on(fileno(input)); 6798 close_on_exec_on(fileno(input));
6791 6799
6800#if ENABLE_HUSH_FUNCTIONS
6792 sv_flg = G.flag_return_in_progress; 6801 sv_flg = G.flag_return_in_progress;
6793 /* "we are inside sourced file, ok to use return" */ 6802 /* "we are inside sourced file, ok to use return" */
6794 G.flag_return_in_progress = -1; 6803 G.flag_return_in_progress = -1;
6804#endif
6795 save_and_replace_G_args(&sv, argv); 6805 save_and_replace_G_args(&sv, argv);
6796 6806
6797 parse_and_run_file(input); 6807 parse_and_run_file(input);
6798 fclose(input); 6808 fclose(input);
6799 6809
6800 restore_G_args(&sv, argv); 6810 restore_G_args(&sv, argv);
6811#if ENABLE_HUSH_FUNCTIONS
6801 G.flag_return_in_progress = sv_flg; 6812 G.flag_return_in_progress = sv_flg;
6813#endif
6802 6814
6803 return G.last_exitcode; 6815 return G.last_exitcode;
6804} 6816}