Skip to content

Commit

Permalink
data/signals.c: fix empty SIGINT/SIGPIPE messages
Browse files Browse the repository at this point in the history
src/cmd/ksh93/data/signals.c includes two checks for the JOBS
identifier; if it is not defined then the interactive shell's
background job signal messages for SIGINT and SIGPIPE are empty.
The cause was that the "jobs.h" header, which defines that ID, was
not #included in signals.c. This commit adds that #include.
(ksh 93u+, ksh 93v- and ksh2020 all have this bug as well.)

Before:

$ sleep 30 &
[1]	86430
$ kill -s INT "$!"
[1] +                          sleep 30 &
$

After:

$ sleep 30 &
[1]	86445
$ kill -s INT "$!"
[1] + Interrupt                sleep 30 &
$
  • Loading branch information
McDutchie committed Sep 18, 2020
1 parent 13c3fb2 commit 06e721c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Any uppercase BUG_* names are modernish shell bug IDs.
<ESC> 7 <left-arrow> will now move the cursor seven positions to the left.
In vi control mode, this would be entered as: 7 <left-arrow>.

- When a background job on an interactive shell received SIGINT or SIGPIPE, the
job termination message was empty. It now shows "Interrupt" or "Broken Pipe".

2020-09-14:

- Corrected rounding of floating point values by ksh's printf %f formatting
Expand Down
1 change: 1 addition & 0 deletions src/cmd/ksh93/data/signals.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* *
***********************************************************************/
#include "defs.h"
#include "jobs.h"

#if defined(SIGCLD) && !defined(SIGCHLD)
# define SIGCHLD SIGCLD
Expand Down

0 comments on commit 06e721c

Please sign in to comment.