1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Fix more "/dev/null: cannot create" (re: 411481eb)

Reproducer:

  trap : USR1
  while :; do kill -s USR1 $$ || exit; done &
  while :; do : >/dev/null; done

It can take between a fraction of a second and a few minutes, but
eventually it will fail like this:

  $ ksh foo
  foo[3]: /dev/null: cannot create
  kill: 77946: no such process

It fails similarly with "cannot open" if </dev/null is used instead
of >/dev/null.

This is the same problem as in the referenced commit, except when
handling traps -- so the same fix is required in sh_fault().
This commit is contained in:
Martijn Dekker 2022-06-20 18:41:28 +01:00
parent 7af1d56e7f
commit 225323f138
3 changed files with 28 additions and 12 deletions

5
NEWS
View file

@ -3,6 +3,11 @@ For full details, see the git log at: https://github.com/ksh93/ksh/tree/1.0
Any uppercase BUG_* names are modernish shell bug IDs.
2022-06-20:
- Fixed a race condition that could cause redirections to fail with a
"cannot create" or "cannot open" error while processing a signal trap.
2022-06-18:
- Fixed a bug where, with the monitor or pipefail option on, the shell