mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* win32/win32.[ch] (rb_w32_isatty): new function to replace MSVCRT's
isatty because it never sets errno. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5141d3ea79
commit
fce2bb5ea8
3 changed files with 24 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Nov 18 20:47:24 2004 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* win32/win32.[ch] (rb_w32_isatty): new function to replace MSVCRT's
|
||||||
|
isatty because it never sets errno.
|
||||||
|
|
||||||
Thu Nov 18 17:05:01 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Nov 18 17:05:01 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* parse.y (f_rest_arg): store rest args into invisible local variabe
|
* parse.y (f_rest_arg): store rest args into invisible local variabe
|
||||||
|
@ -204,7 +209,7 @@ Fri Nov 12 15:15:06 2004 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
* eval.c (ruby_options): now we cannot call rb_glob() before
|
* eval.c (ruby_options): now we cannot call rb_glob() before
|
||||||
ruby_init(), so call rb_w32_cmdvector() at ruby_options().
|
ruby_init(), so call rb_w32_cmdvector() at ruby_options().
|
||||||
|
|
||||||
* win32.{c,h} (rb_w32_cmdvector): rename make_cmdvector() and
|
* win32/win32.{c,h} (rb_w32_cmdvector): rename make_cmdvector() and
|
||||||
export it.
|
export it.
|
||||||
|
|
||||||
Fri Nov 12 14:08:01 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
Fri Nov 12 14:08:01 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
|
@ -3424,6 +3424,20 @@ rb_w32_snprintf(char *buf, size_t size, const char *format, ...)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
rb_w32_isatty(int fd)
|
||||||
|
{
|
||||||
|
if (!(_osfile(fd) & FOPEN)) {
|
||||||
|
errno = EBADF;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (!(_osfile(fd) & FDEV)) {
|
||||||
|
errno = ENOTTY;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Fix bcc32's stdio bug
|
// Fix bcc32's stdio bug
|
||||||
//
|
//
|
||||||
|
|
|
@ -121,11 +121,14 @@ extern "C++" {
|
||||||
#undef fsopen
|
#undef fsopen
|
||||||
#define fsopen(p, m, sh) rb_w32_fsopen(p, m, sh)
|
#define fsopen(p, m, sh) rb_w32_fsopen(p, m, sh)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define fsync(h) _commit(h)
|
#define fsync(h) _commit(h)
|
||||||
#undef stat
|
#undef stat
|
||||||
#define stat(path,st) rb_w32_stat(path,st)
|
#define stat(path,st) rb_w32_stat(path,st)
|
||||||
#undef execv
|
#undef execv
|
||||||
#define execv(path,argv) rb_w32_aspawn(P_OVERLAY,path,argv)
|
#define execv(path,argv) rb_w32_aspawn(P_OVERLAY,path,argv)
|
||||||
|
#undef isatty
|
||||||
|
#define isatty(h) rb_w32_isatty(h)
|
||||||
|
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
struct timezone {
|
struct timezone {
|
||||||
|
@ -185,6 +188,7 @@ extern int rb_w32_aspawn(int, const char *, char *const *);
|
||||||
extern int kill(int, int);
|
extern int kill(int, int);
|
||||||
extern int fcntl(int, int, ...);
|
extern int fcntl(int, int, ...);
|
||||||
extern pid_t rb_w32_getpid(void);
|
extern pid_t rb_w32_getpid(void);
|
||||||
|
extern int rb_w32_isatty(int);
|
||||||
|
|
||||||
#ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
extern int rb_w32_fstat(int, struct stat *);
|
extern int rb_w32_fstat(int, struct stat *);
|
||||||
|
|
Loading…
Reference in a new issue