aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-07-10 10:00:28 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-07-10 10:00:28 +0200
commit1609629a918f0e5c8813a113447347db61be7b74 (patch)
tree383da74f71cd1ea22198cfcc6c3ba22ce12a7911
parent12a4f9afe702b89c616610d3a29bf08257c6bace (diff)
downloadbusybox-w32-1609629a918f0e5c8813a113447347db61be7b74.tar.gz
busybox-w32-1609629a918f0e5c8813a113447347db61be7b74.tar.bz2
busybox-w32-1609629a918f0e5c8813a113447347db61be7b74.zip
hush: rename a few functions
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/hush.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/shell/hush.c b/shell/hush.c
index b131f6095..3533dfaa4 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -7217,7 +7217,7 @@ static const char *get_cmdtext(struct pipe *pi)
7217 return pi->cmdtext; 7217 return pi->cmdtext;
7218} 7218}
7219 7219
7220static void insert_bg_job(struct pipe *pi) 7220static void insert_job_into_table(struct pipe *pi)
7221{ 7221{
7222 struct pipe *job, **jobp; 7222 struct pipe *job, **jobp;
7223 int i; 7223 int i;
@@ -7249,7 +7249,7 @@ static void insert_bg_job(struct pipe *pi)
7249 G.last_jobid = job->jobid; 7249 G.last_jobid = job->jobid;
7250} 7250}
7251 7251
7252static void remove_bg_job(struct pipe *pi) 7252static void remove_job_from_table(struct pipe *pi)
7253{ 7253{
7254 struct pipe *prev_pipe; 7254 struct pipe *prev_pipe;
7255 7255
@@ -7268,9 +7268,9 @@ static void remove_bg_job(struct pipe *pi)
7268} 7268}
7269 7269
7270/* Remove a backgrounded job */ 7270/* Remove a backgrounded job */
7271static void delete_finished_bg_job(struct pipe *pi) 7271static void delete_finished_job(struct pipe *pi)
7272{ 7272{
7273 remove_bg_job(pi); 7273 remove_job_from_table(pi);
7274 free_pipe(pi); 7274 free_pipe(pi);
7275} 7275}
7276#endif /* JOB */ 7276#endif /* JOB */
@@ -7359,7 +7359,7 @@ static int process_wait_result(struct pipe *fg_pipe, pid_t childpid, int status)
7359 if (G_interactive_fd) { 7359 if (G_interactive_fd) {
7360#if ENABLE_HUSH_JOB 7360#if ENABLE_HUSH_JOB
7361 if (fg_pipe->alive_cmds != 0) 7361 if (fg_pipe->alive_cmds != 0)
7362 insert_bg_job(fg_pipe); 7362 insert_job_into_table(fg_pipe);
7363#endif 7363#endif
7364 return rcode; 7364 return rcode;
7365 } 7365 }
@@ -7400,7 +7400,7 @@ static int process_wait_result(struct pipe *fg_pipe, pid_t childpid, int status)
7400 if (G_interactive_fd) 7400 if (G_interactive_fd)
7401 printf(JOB_STATUS_FORMAT, pi->jobid, 7401 printf(JOB_STATUS_FORMAT, pi->jobid,
7402 "Done", pi->cmdtext); 7402 "Done", pi->cmdtext);
7403 delete_finished_bg_job(pi); 7403 delete_finished_job(pi);
7404//bash deletes finished jobs from job table only in interactive mode, after "jobs" cmd, 7404//bash deletes finished jobs from job table only in interactive mode, after "jobs" cmd,
7405//or if pid of a new process matches one of the old ones 7405//or if pid of a new process matches one of the old ones
7406//(see cleanup_dead_jobs(), delete_old_job(), J_NOTIFIED in bash source). 7406//(see cleanup_dead_jobs(), delete_old_job(), J_NOTIFIED in bash source).
@@ -8219,7 +8219,7 @@ static int run_list(struct pipe *pi)
8219 * I'm NOT treating inner &'s as jobs */ 8219 * I'm NOT treating inner &'s as jobs */
8220#if ENABLE_HUSH_JOB 8220#if ENABLE_HUSH_JOB
8221 if (G.run_list_level == 1) 8221 if (G.run_list_level == 1)
8222 insert_bg_job(pi); 8222 insert_job_into_table(pi);
8223#endif 8223#endif
8224 /* Last command's pid goes to $! */ 8224 /* Last command's pid goes to $! */
8225 G.last_bg_pid = pi->cmds[pi->num_cmds - 1].pid; 8225 G.last_bg_pid = pi->cmds[pi->num_cmds - 1].pid;
@@ -9702,14 +9702,14 @@ static int FAST_FUNC builtin_fg_bg(char **argv)
9702 i = kill(- pi->pgrp, SIGCONT); 9702 i = kill(- pi->pgrp, SIGCONT);
9703 if (i < 0) { 9703 if (i < 0) {
9704 if (errno == ESRCH) { 9704 if (errno == ESRCH) {
9705 delete_finished_bg_job(pi); 9705 delete_finished_job(pi);
9706 return EXIT_SUCCESS; 9706 return EXIT_SUCCESS;
9707 } 9707 }
9708 bb_perror_msg("kill (SIGCONT)"); 9708 bb_perror_msg("kill (SIGCONT)");
9709 } 9709 }
9710 9710
9711 if (argv[0][0] == 'f') { 9711 if (argv[0][0] == 'f') {
9712 remove_bg_job(pi); 9712 remove_job_from_table(pi); /* FG job shouldn't be in job table */
9713 return checkjobs_and_fg_shell(pi); 9713 return checkjobs_and_fg_shell(pi);
9714 } 9714 }
9715 return EXIT_SUCCESS; 9715 return EXIT_SUCCESS;
@@ -9909,7 +9909,7 @@ static int FAST_FUNC builtin_wait(char **argv)
9909# if 0 9909# if 0
9910 else { 9910 else {
9911 if (!wait_pipe->alive_cmds) 9911 if (!wait_pipe->alive_cmds)
9912 delete_finished_bg_job(wait_pipe); 9912 delete_finished_job(wait_pipe);
9913 } 9913 }
9914# endif 9914# endif
9915 } 9915 }