aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbb/vfork_daemon_rexec.c2
-rw-r--r--shell/hush.c16
2 files changed, 10 insertions, 8 deletions
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index aef74e994..a2572b0a9 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -100,6 +100,7 @@ int wait_pid(int *wstat, int pid)
100 return r; 100 return r;
101} 101}
102 102
103#if ENABLE_FEATURE_PREFER_APPLETS
103void save_nofork_data(struct nofork_save_area *save) 104void save_nofork_data(struct nofork_save_area *save)
104{ 105{
105 save->current_applet = current_applet; 106 save->current_applet = current_applet;
@@ -162,6 +163,7 @@ int run_nofork_applet(const struct bb_applet *a, char **argv)
162 save_nofork_data(&old); 163 save_nofork_data(&old);
163 return run_nofork_applet_prime(&old, a, argv); 164 return run_nofork_applet_prime(&old, a, argv);
164} 165}
166#endif /* FEATURE_PREFER_APPLETS */
165 167
166int spawn_and_wait(char **argv) 168int spawn_and_wait(char **argv)
167{ 169{
diff --git a/shell/hush.c b/shell/hush.c
index 7a4d7f934..0a035cad4 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -486,6 +486,10 @@ static const struct built_in_command bltins[] = {
486 { NULL, NULL, NULL } 486 { NULL, NULL, NULL }
487}; 487};
488 488
489#if ENABLE_FEATURE_SH_STANDALONE
490struct nofork_save_area nofork_save;
491#endif
492
489#if ENABLE_HUSH_JOB 493#if ENABLE_HUSH_JOB
490 494
491/* move to libbb? */ 495/* move to libbb? */
@@ -537,10 +541,6 @@ static void set_every_sighandler(void (*handler)(int))
537static struct pipe *toplevel_list; 541static struct pipe *toplevel_list;
538static sigjmp_buf toplevel_jb; 542static sigjmp_buf toplevel_jb;
539smallint ctrl_z_flag; 543smallint ctrl_z_flag;
540#if ENABLE_FEATURE_SH_STANDALONE
541struct nofork_save_area nofork_save;
542#endif
543
544static void handler_ctrl_c(int sig) 544static void handler_ctrl_c(int sig)
545{ 545{
546 debug_printf_jobs("got sig %d\n", sig); 546 debug_printf_jobs("got sig %d\n", sig);
@@ -1105,7 +1105,9 @@ static int file_get(struct in_str *i)
1105 1105
1106 /* If there is data waiting, eat it up */ 1106 /* If there is data waiting, eat it up */
1107 if (i->p && *i->p) { 1107 if (i->p && *i->p) {
1108#if ENABLE_HUSH_INTERACTIVE
1108 take_cached: 1109 take_cached:
1110#endif
1109 ch = *i->p++; 1111 ch = *i->p++;
1110 if (i->eof_flag && !*i->p) 1112 if (i->eof_flag && !*i->p)
1111 ch = EOF; 1113 ch = EOF;
@@ -1120,11 +1122,9 @@ static int file_get(struct in_str *i)
1120 i->promptmode = 2; 1122 i->promptmode = 2;
1121 i->__promptme = 0; 1123 i->__promptme = 0;
1122 goto take_cached; 1124 goto take_cached;
1123 } else
1124#endif
1125 {
1126 ch = fgetc(i->file);
1127 } 1125 }
1126#endif
1127 ch = fgetc(i->file);
1128 } 1128 }
1129 debug_printf("file_get: got a '%c' %d\n", ch, ch); 1129 debug_printf("file_get: got a '%c' %d\n", ch, ch);
1130#if ENABLE_HUSH_INTERACTIVE 1130#if ENABLE_HUSH_INTERACTIVE