libxl: save/restore errno in SIGCHLD handler
PATCH 1/1 libxl: save/restore errno in SIGCHLD handler
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.
--- tools/libxl/libxl_fork.c | 2 ++ 1 file changed, 2 insertions(+)
tools/libxl/libxl_fork.c +2 -0
@@ -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 )
Signature · 1 line
1.7.10.4
Quoted 7 lines · Ian Jackson
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 <[email protected]>
Quoted 19 lines
--- tools/libxl/libxl_fork.c | 2 ++ 1 file changed, 2 insertions(+)tools/libxl/libxl_fork.c +2
-0@@ -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 )
Ian Campbell writes ("Re: [PATCH] libxl: save/restore errno in SIGCHLD handler"):
Quoted 10 lines · Ian Jackson
Quoted 7 lines
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 <[email protected]>Acked-by Ian Campbell <[email protected]>
Thanks, pushed.
Ian.
Ian Jackson writes ("Re: [PATCH] libxl: save/restore errno in SIGCHLD handler"):
Quoted 6 lines
Ian Campbell writes ("Re: [PATCH] libxl: save/restore errno in SIGCHLD handler"):
Quoted 5 lines · Ian Jackson
Quoted 4 lines
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.)
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
This fix should be backported in due course.
Signed-off-by Ian Jackson <[email protected]>Acked-by Ian Campbell <[email protected]>Thanks, pushed.
Now applied to 4.3. Was not applicable to 4.2, 4.1.
Ian.