diff options
| author | Toby Goodwin <toby@paccrat.org> | 2017-11-17 07:36:25 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-17 07:36:25 +0000 |
| commit | c5b1bdce2ced84fe956a56a206d7964e60f3f641 (patch) | |
| tree | d121d514f43a766ad82956fdafb31b3dd3ad98f2 /status.c | |
| parent | 7dc3033c862c30d8998ed3e4c98c056286f31401 (diff) | |
| parent | 266dac97fd1cbd2e14cf7a9ca0fda4e446c75e3c (diff) | |
Merge pull request #41 from muennich/issue40
Fix issue #40
Diffstat (limited to 'status.c')
| -rw-r--r-- | status.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -7,6 +7,8 @@ /* status == the wait() value of the last command in the pipeline, or the last command */ +static void statprint(pid_t, int); + static int statuses[512]; static int pipelength = 1; @@ -49,8 +51,8 @@ extern void set(bool code) { extern void setpipestatus(int stats[], int num) { int i; for (i = 0; i < (pipelength = num); i++) { - statprint(-1, stats[i]); statuses[i] = stats[i]; + statprint(-1, stats[i]); } } @@ -64,7 +66,7 @@ extern void setstatus(pid_t pid, int i) { /* print a message if termination was with a signal, and if the child dumped core. exit on error if -e is set */ -extern void statprint(pid_t pid, int i) { +static void statprint(pid_t pid, int i) { if (WIFSIGNALED(i)) { int t = WTERMSIG(i); char *msg = ((t > 0) && (t < NUMOFSIGNALS) ? signals[WTERMSIG(i)].msg : ""); |