1 Subject: [PATCH] Handle EINTR when calling tcsetattr
3 The OS X version of sudo properly handles EINTR when returned from
4 tcsetattr in the term_restore and term_noecho functions by simply
5 repeating the function call again.
7 term.c | 18 ++++++++++++++----
8 1 file changed, 14 insertions(+), 4 deletions(-)
10 diff --git a/term.c b/term.c
11 index 4aa71284..596d79d2 100644
18 +#include <sys/errno.h>
19 #include <sys/types.h>
20 #include <sys/param.h>
22 @@ -111,8 +112,13 @@ term_restore(fd, flush)
25 flags |= flush ? TCSAFLUSH : TCSADRAIN;
26 - if (tcsetattr(fd, flags, &oterm) != 0)
28 + if (tcsetattr(fd, flags, &oterm) == 0)
37 @@ -129,9 +135,13 @@ term_noecho(fd)
39 term.c_cc[VSTATUS] = _POSIX_VDISABLE;
41 - if (tcsetattr(fd, TCSADRAIN|TCSASOFT, &term) == 0) {
45 + if (tcsetattr(fd, TCSADRAIN|TCSASOFT, &term) == 0) {