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

Re: [Xen-devel] [PATCH] libxl: save/restore errno in SIGCHLD handler



On Mon, 2013-11-11 at 17:20 +0000, Ian Jackson wrote:
> Without this, code interrupted by SIGCHLD may experience strange
> values of errno.  (As far as I know this is not the cause of any
> reported bugs.)
> 
> This fix should be backported in due course.
> 
> Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

> ---
>  tools/libxl/libxl_fork.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/libxl/libxl_fork.c b/tools/libxl/libxl_fork.c
> index 044ddad..b6f0b2d 100644
> --- a/tools/libxl/libxl_fork.c
> +++ b/tools/libxl/libxl_fork.c
> @@ -157,8 +157,10 @@ int libxl__carefd_fd(const libxl__carefd *cf)
>  
>  static void sigchld_handler(int signo)
>  {
> +    int esave = errno;
>      int e = libxl__self_pipe_wakeup(sigchld_owner->sigchld_selfpipe[1]);
>      assert(!e); /* errors are probably EBADF, very bad */
> +    errno = esave;
>  }
>  
>  static void sigchld_removehandler_core(void)



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.