* [PATCH] libxl: save/restore errno in SIGCHLD handler
@ 2013-11-11 17:20 Ian Jackson
2013-11-11 17:28 ` Ian Campbell
0 siblings, 1 reply; 4+ messages in thread
From: Ian Jackson @ 2013-11-11 17:20 UTC (permalink / raw)
To: xen-devel; +Cc: Ian Campbell
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@eu.citrix.com>
---
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)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] libxl: save/restore errno in SIGCHLD handler
2013-11-11 17:20 [PATCH] libxl: save/restore errno in SIGCHLD handler Ian Jackson
@ 2013-11-11 17:28 ` Ian Campbell
2013-11-12 15:30 ` Ian Jackson
0 siblings, 1 reply; 4+ messages in thread
From: Ian Campbell @ 2013-11-11 17:28 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel
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@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> 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)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] libxl: save/restore errno in SIGCHLD handler
2013-11-11 17:28 ` Ian Campbell
@ 2013-11-12 15:30 ` Ian Jackson
2013-11-25 13:58 ` Ian Jackson
0 siblings, 1 reply; 4+ messages in thread
From: Ian Jackson @ 2013-11-12 15:30 UTC (permalink / raw)
To: Ian Campbell; +Cc: xen-devel
Ian Campbell writes ("Re: [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@eu.citrix.com>
>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
Thanks, pushed.
Ian.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] libxl: save/restore errno in SIGCHLD handler
2013-11-12 15:30 ` Ian Jackson
@ 2013-11-25 13:58 ` Ian Jackson
0 siblings, 0 replies; 4+ messages in thread
From: Ian Jackson @ 2013-11-25 13:58 UTC (permalink / raw)
To: Ian Campbell, xen-devel, Jan Beulich
Ian Jackson writes ("Re: [PATCH] libxl: save/restore errno in SIGCHLD handler"):
> Ian Campbell writes ("Re: [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@eu.citrix.com>
> >
> > Acked-by: Ian Campbell <ian.campbell@citrix.com>
>
> Thanks, pushed.
Now applied to 4.3. Was not applicable to 4.2, 4.1.
Ian.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-11-25 13:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-11 17:20 [PATCH] libxl: save/restore errno in SIGCHLD handler Ian Jackson
2013-11-11 17:28 ` Ian Campbell
2013-11-12 15:30 ` Ian Jackson
2013-11-25 13:58 ` Ian Jackson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.