mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 02:23:59 +02:00
merge revision(s) 20540:
* win32/win32.c (rb_w32_isatty): check whether fd is valid. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@22418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9d8bb15c5c
commit
440fec216c
3 changed files with 9 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Wed Feb 18 22:28:00 2009 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* win32/win32.c (rb_w32_isatty): check whether fd is valid.
|
||||||
|
|
||||||
Wed Feb 18 22:24:23 2009 NAKAMURA Usaku <usa@ruby-lang.org>
|
Wed Feb 18 22:24:23 2009 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* win32/win32.c (waitpid): fix bug of checking child slot.
|
* win32/win32.c (waitpid): fix bug of checking child slot.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#define RUBY_RELEASE_DATE "2009-02-18"
|
#define RUBY_RELEASE_DATE "2009-02-18"
|
||||||
#define RUBY_VERSION_CODE 187
|
#define RUBY_VERSION_CODE 187
|
||||||
#define RUBY_RELEASE_CODE 20090218
|
#define RUBY_RELEASE_CODE 20090218
|
||||||
#define RUBY_PATCHLEVEL 126
|
#define RUBY_PATCHLEVEL 127
|
||||||
|
|
||||||
#define RUBY_VERSION_MAJOR 1
|
#define RUBY_VERSION_MAJOR 1
|
||||||
#define RUBY_VERSION_MINOR 8
|
#define RUBY_VERSION_MINOR 8
|
||||||
|
|
|
@ -4088,6 +4088,10 @@ rb_w32_unlink(const char *path)
|
||||||
int
|
int
|
||||||
rb_w32_isatty(int fd)
|
rb_w32_isatty(int fd)
|
||||||
{
|
{
|
||||||
|
// validate fd by using _get_osfhandle() because we cannot access _nhandle
|
||||||
|
if (_get_osfhandle(fd) == -1) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (!(_osfile(fd) & FOPEN)) {
|
if (!(_osfile(fd) & FOPEN)) {
|
||||||
errno = EBADF;
|
errno = EBADF;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue