diff options
| author | Ron Yorston <rmy@pobox.com> | 2021-09-07 21:23:19 +0100 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2021-09-08 07:58:14 +0100 |
| commit | 12bc40da28f85cbe97673671f315f847f1dbbabf (patch) | |
| tree | da96e85b876fe73fc68d01796e0de9a8f3ab4ccc | |
| parent | 462863e747da49d4feefb08f8fb81292a9ab722e (diff) | |
| download | busybox-w32-12bc40da28f85cbe97673671f315f847f1dbbabf.tar.gz busybox-w32-12bc40da28f85cbe97673671f315f847f1dbbabf.tar.bz2 busybox-w32-12bc40da28f85cbe97673671f315f847f1dbbabf.zip | |
ash: code shrink ps_cmd
The ps_cmd member of struct procstat isn't used in the WIN32 port.
Remove references to it.
Saves 80 bytes.
| -rw-r--r-- | shell/ash.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/shell/ash.c b/shell/ash.c index faf861583..508633689 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
| @@ -4065,11 +4065,12 @@ unaliascmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
| 4065 | */ | 4065 | */ |
| 4066 | struct procstat { | 4066 | struct procstat { |
| 4067 | pid_t ps_pid; /* process id */ | 4067 | pid_t ps_pid; /* process id */ |
| 4068 | #if ENABLE_PLATFORM_MINGW32 | ||
| 4069 | HANDLE ps_proc; | ||
| 4070 | #endif | ||
| 4071 | int ps_status; /* last process status from wait() */ | 4068 | int ps_status; /* last process status from wait() */ |
| 4069 | #if !ENABLE_PLATFORM_MINGW32 | ||
| 4072 | char *ps_cmd; /* text of command being run */ | 4070 | char *ps_cmd; /* text of command being run */ |
| 4071 | #else | ||
| 4072 | HANDLE ps_proc; | ||
| 4073 | #endif | ||
| 4073 | }; | 4074 | }; |
| 4074 | 4075 | ||
| 4075 | struct job { | 4076 | struct job { |
| @@ -4502,14 +4503,18 @@ getjob(const char *name, int getctl) | |||
| 4502 | static void | 4503 | static void |
| 4503 | freejob(struct job *jp) | 4504 | freejob(struct job *jp) |
| 4504 | { | 4505 | { |
| 4506 | #if !ENABLE_PLATFORM_MINGW32 | ||
| 4505 | struct procstat *ps; | 4507 | struct procstat *ps; |
| 4506 | int i; | 4508 | int i; |
| 4509 | #endif | ||
| 4507 | 4510 | ||
| 4508 | INT_OFF; | 4511 | INT_OFF; |
| 4512 | #if !ENABLE_PLATFORM_MINGW32 | ||
| 4509 | for (i = jp->nprocs, ps = jp->ps; --i >= 0; ps++) { | 4513 | for (i = jp->nprocs, ps = jp->ps; --i >= 0; ps++) { |
| 4510 | if (ps->ps_cmd != nullstr) | 4514 | if (ps->ps_cmd != nullstr) |
| 4511 | free(ps->ps_cmd); | 4515 | free(ps->ps_cmd); |
| 4512 | } | 4516 | } |
| 4517 | #endif | ||
| 4513 | if (jp->ps != &jp->ps0) | 4518 | if (jp->ps != &jp->ps0) |
| 4514 | free(jp->ps); | 4519 | free(jp->ps); |
| 4515 | jp->used = 0; | 4520 | jp->used = 0; |
| @@ -5884,11 +5889,12 @@ forkparent(struct job *jp, union node *n, int mode, HANDLE proc) | |||
| 5884 | if (jp) { | 5889 | if (jp) { |
| 5885 | struct procstat *ps = &jp->ps[jp->nprocs++]; | 5890 | struct procstat *ps = &jp->ps[jp->nprocs++]; |
| 5886 | ps->ps_pid = pid; | 5891 | ps->ps_pid = pid; |
| 5887 | #if ENABLE_PLATFORM_MINGW32 | ||
| 5888 | ps->ps_proc = proc; | ||
| 5889 | #endif | ||
| 5890 | ps->ps_status = -1; | 5892 | ps->ps_status = -1; |
| 5893 | #if !ENABLE_PLATFORM_MINGW32 | ||
| 5891 | ps->ps_cmd = nullstr; | 5894 | ps->ps_cmd = nullstr; |
| 5895 | #else | ||
| 5896 | ps->ps_proc = proc; | ||
| 5897 | #endif | ||
| 5892 | #if JOBS | 5898 | #if JOBS |
| 5893 | if (doing_jobctl && n) | 5899 | if (doing_jobctl && n) |
| 5894 | ps->ps_cmd = commandtext(n); | 5900 | ps->ps_cmd = commandtext(n); |
