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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 10 Feb 2011 11:27:55 +0200
Alexander Nezhinsky <alexandern@xxxxxxxxxxxx> 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@xxxxxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux