]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r217557: sh: Fix signal messages being sent to the wrong file sometimes.
authorjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 5 Feb 2011 20:25:17 +0000 (20:25 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 5 Feb 2011 20:25:17 +0000 (20:25 +0000)
commitb8eb4052f2519cd582d67f858f1399c220204603
treeb15025d59b8a34f9bff83bf85a41f7713f5aecae
parent9af080d7bd24b46e0ef48991d800dc5a14724f21
MFC r217557: sh: Fix signal messages being sent to the wrong file sometimes.

When a foreground job exits on a signal, a message is printed to stdout
about this. The buffer was not flushed after this which could result in the
message being written to the wrong file if the next command was a builtin
and had stdout redirected.

Example:
  sh -c 'kill -9 $$'; : > foo; echo FOO:; cat foo

git-svn-id: svn://svn.freebsd.org/base/stable/8@218337 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
bin/sh/jobs.c
tools/regression/bin/sh/execution/killed1.0 [new file with mode: 0644]