Skip to content

Commit

Permalink
* io.c (io_reopen): remove cygwin handling because it seems to be for
Browse files Browse the repository at this point in the history
	  C's stdio.
	  fixed [ruby-dev:35183]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
unak committed Jun 24, 2008
1 parent 5bf133e commit 404dda9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Tue Jun 24 16:51:51 2008 NAKAMURA Usaku <[email protected]>

* io.c (io_reopen): remove cygwin handling because it seems to be for
C's stdio.
fixed [ruby-dev:35183]

Tue Jun 24 11:12:33 2008 NAKAMURA Usaku <[email protected]>

* include/ruby/win32.h, win32/win32.c (rb_w32_getppid): now support
Expand Down
6 changes: 0 additions & 6 deletions io.c
Original file line number Diff line number Diff line change
Expand Up @@ -4410,7 +4410,6 @@ io_reopen(VALUE io, VALUE nfile)
GetOpenFile(nfile, orig);

if (fptr == orig) return io;
#if !defined __CYGWIN__
if (IS_PREP_STDIO(fptr)) {
if ((fptr->stdio_file == stdin && !(orig->mode & FMODE_READABLE)) ||
(fptr->stdio_file == stdout && !(orig->mode & FMODE_WRITABLE)) ||
Expand All @@ -4421,7 +4420,6 @@ io_reopen(VALUE io, VALUE nfile)
rb_io_flags_mode(orig->mode));
}
}
#endif
if (orig->mode & FMODE_READABLE) {
pos = io_tell(orig);
}
Expand All @@ -4444,14 +4442,12 @@ io_reopen(VALUE io, VALUE nfile)
fd = fptr->fd;
fd2 = orig->fd;
if (fd != fd2) {
#if !defined __CYGWIN__
if (IS_PREP_STDIO(fptr)) {
/* need to keep stdio objects */
if (dup2(fd2, fd) < 0)
rb_sys_fail(orig->path);
}
else {
#endif
if (fptr->stdio_file)
fclose(fptr->stdio_file);
else
Expand All @@ -4461,9 +4457,7 @@ io_reopen(VALUE io, VALUE nfile)
if (dup2(fd2, fd) < 0)
rb_sys_fail(orig->path);
fptr->fd = fd;
#if !defined __CYGWIN__
}
#endif
rb_thread_fd_close(fd);
if ((orig->mode & FMODE_READABLE) && pos >= 0) {
if (io_seek(fptr, pos, SEEK_SET) < 0) {
Expand Down

0 comments on commit 404dda9

Please sign in to comment.