diff options
author | Ron Yorston <rmy@pobox.com> | 2018-04-10 21:46:34 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2018-04-10 21:46:34 +0100 |
commit | 072edb130eaabd50961df71156c3ca7d0773d690 (patch) | |
tree | e25f9134b32c85836787df4a167bea1cde125bac | |
parent | 942f872781630147d3f05e08ee3998679e7e892e (diff) | |
download | busybox-w32-072edb130eaabd50961df71156c3ca7d0773d690.tar.gz busybox-w32-072edb130eaabd50961df71156c3ca7d0773d690.tar.bz2 busybox-w32-072edb130eaabd50961df71156c3ca7d0773d690.zip |
ash: make struct forkshell a local variable in evalbackcmd
There's no reason for the forkshell structure to be passed
between expbackq and evalbackcmd in the backcmd structure.
It can be a local variable, as in the other similar cases.
-rw-r--r-- | shell/ash.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/shell/ash.c b/shell/ash.c index 35438a887..208fce538 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -6732,7 +6732,6 @@ struct backcmd { /* result of evalbackcmd */ | |||
6732 | int fd; /* file descriptor to read from */ | 6732 | int fd; /* file descriptor to read from */ |
6733 | int nleft; /* number of chars in buffer */ | 6733 | int nleft; /* number of chars in buffer */ |
6734 | char *buf; /* buffer */ | 6734 | char *buf; /* buffer */ |
6735 | IF_PLATFORM_MINGW32(struct forkshell fs); | ||
6736 | struct job *jp; /* job structure for command */ | 6735 | struct job *jp; /* job structure for command */ |
6737 | }; | 6736 | }; |
6738 | 6737 | ||
@@ -6760,11 +6759,11 @@ evalbackcmd(union node *n, struct backcmd *result) | |||
6760 | { | 6759 | { |
6761 | int pip[2]; | 6760 | int pip[2]; |
6762 | struct job *jp; | 6761 | struct job *jp; |
6762 | IF_PLATFORM_MINGW32(struct forkshell fs); | ||
6763 | 6763 | ||
6764 | result->fd = -1; | 6764 | result->fd = -1; |
6765 | result->buf = NULL; | 6765 | result->buf = NULL; |
6766 | result->nleft = 0; | 6766 | result->nleft = 0; |
6767 | IF_PLATFORM_MINGW32(memset(&result->fs, 0, sizeof(result->fs))); | ||
6768 | result->jp = NULL; | 6767 | result->jp = NULL; |
6769 | if (n == NULL) { | 6768 | if (n == NULL) { |
6770 | goto out; | 6769 | goto out; |
@@ -6774,11 +6773,12 @@ evalbackcmd(union node *n, struct backcmd *result) | |||
6774 | ash_msg_and_raise_perror("can't create pipe"); | 6773 | ash_msg_and_raise_perror("can't create pipe"); |
6775 | jp = makejob(/*n,*/ 1); | 6774 | jp = makejob(/*n,*/ 1); |
6776 | #if ENABLE_PLATFORM_MINGW32 | 6775 | #if ENABLE_PLATFORM_MINGW32 |
6777 | result->fs.fpid = FS_EVALBACKCMD; | 6776 | memset(&fs, 0, sizeof(fs)); |
6778 | result->fs.n = n; | 6777 | fs.fpid = FS_EVALBACKCMD; |
6779 | result->fs.fd[0] = pip[0]; | 6778 | fs.n = n; |
6780 | result->fs.fd[1] = pip[1]; | 6779 | fs.fd[0] = pip[0]; |
6781 | if (spawn_forkshell(jp, &result->fs, FORK_NOJOB) < 0) | 6780 | fs.fd[1] = pip[1]; |
6781 | if (spawn_forkshell(jp, &fs, FORK_NOJOB) < 0) | ||
6782 | ash_msg_and_raise_error("unable to spawn shell"); | 6782 | ash_msg_and_raise_error("unable to spawn shell"); |
6783 | #else | 6783 | #else |
6784 | if (forkshell(jp, n, FORK_NOJOB) == 0) { | 6784 | if (forkshell(jp, n, FORK_NOJOB) == 0) { |