From 0576ba52680304975865d38905a5810b97581a7e Mon Sep 17 00:00:00 2001 From: Jason Zaman Date: Sun, 3 Jul 2016 14:20:22 +0800 Subject: [PATCH] open_init_pty: Do not error on EINTR There is a signal handler so that the select returns EINTR when the child exits. EINTR is used to then clean up and flush the remaining buffers. It should not error. Signed-off-by: Jason Zaman --- policycoreutils/run_init/open_init_pty.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/policycoreutils/run_init/open_init_pty.c b/policycoreutils/run_init/open_init_pty.c index 37805bf5..6e25ea31 100644 --- a/policycoreutils/run_init/open_init_pty.c +++ b/policycoreutils/run_init/open_init_pty.c @@ -327,8 +327,9 @@ int main(int argc, char *argv[]) break; } + errno = 0; int select_rc = select(pty_master + 1, &readfds, &writefds, NULL, NULL); - if (select_rc < 0) { + if (select_rc < 0 && errno != EINTR) { perror("select()"); exit(EX_IOERR); }