[stgt] [PATCH] fixes in call_program (closing pipe fds, waitpid interrupted by a signal)

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Thu Feb 10 10:37:34 CET 2011


On Thu, 10 Feb 2011 11:27:55 +0200
Alexander Nezhinsky <alexandern at Voltaire.COM> wrote:

> Some fixes in call_program():
> 1) if fork() fails, previously open pipe file descriptors should be closed.
> 2) the redirect script is invoked from a fork'ed process so tgt has to wait
> for its child. Currently this is done synchronously using waitpid().
> Sometimes the system call is interrupted by a signal (most probably by
> a SIGCHLD signal from the very process that is being waited upon).
> To overcome this, waitpid() is called repeatedly while the error code
> is "Interrupted by a signal". Other reasons for failure are non-existing
> process or invalid arguments, so in these cases we shall just give up.
> 
> Signed-off-by: Alexander Nezhinsky <alexandern at voltaire.com>
> ---
>  usr/tgtd.c |   32 +++++++++++++++++++++++++-------
>  1 files changed, 25 insertions(+), 7 deletions(-)

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list