diff options
| author | Toby Goodwin <toby@paccrat.org> | 2018-03-01 21:37:18 +0000 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2018-03-01 21:37:18 +0000 |
| commit | 5b624196125034b95d504be682127a5964e08da5 (patch) | |
| tree | 56d3477069e7541dcb67f36fc3b960f6f9abe076 /status.c | |
| parent | 5966ab2ca2632c5bed9815def1add4859beececa (diff) | |
| parent | 67a87ad0104d88e8b1711a3831d616598edb30c2 (diff) | |
Merge branch 'master' into ifnot
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 : ""); |