* ext/io/console/console.c (setattr): should retry on EINTR.

[ruby-dev:42666]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-12-01 22:08:41 +00:00
Родитель ec8f4038c9
Коммит 0e24a11b59
2 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Thu Dec 2 07:08:38 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/io/console/console.c (setattr): should retry on EINTR.
[ruby-dev:42666]
Thu Dec 2 02:30:50 2010 Eric Hodel <drbrain@segment7.net> Thu Dec 2 02:30:50 2010 Eric Hodel <drbrain@segment7.net>
* lib/net/http.rb: fixed positional wording to match revised order. * lib/net/http.rb: fixed positional wording to match revised order.

Просмотреть файл

@ -26,7 +26,15 @@ typedef OpenFile rb_io_t;
#if defined HAVE_TERMIOS_H #if defined HAVE_TERMIOS_H
# include <termios.h> # include <termios.h>
typedef struct termios conmode; typedef struct termios conmode;
# define setattr(fd, t) (tcsetattr(fd, TCSAFLUSH, t) == 0)
static int
setattr(int fd, conmode *t)
{
while (tcsetattr(fd, TCSAFLUSH, t)) {
if (errno != EINTR) return 0;
}
return 1;
}
# define getattr(fd, t) (tcgetattr(fd, t) == 0) # define getattr(fd, t) (tcgetattr(fd, t) == 0)
#elif defined HAVE_TERMIO_H #elif defined HAVE_TERMIO_H
# include <termio.h> # include <termio.h>