mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* io.c (nogvl_fsync, nogvl_fdatasync): on Windows, just ignore if the
fd is associated to non-disk device. if call fsync and/or fdatasync with such fds, it causes Errno::EBADF exception and the behavior is incomatible with ruby 2.1 and earlier unintendedly introduced. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8a1c7babec
commit
0df79477bd
2 changed files with 15 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
Tue Aug 30 14:53:34 2016 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* io.c (nogvl_fsync, nogvl_fdatasync): on Windows, just ignore if the
|
||||
fd is associated to non-disk device. if call fsync and/or fdatasync
|
||||
with such fds, it causes Errno::EBADF exception and the behavior is
|
||||
incomatible with ruby 2.1 and earlier unintendedly introduced.
|
||||
|
||||
Tue Aug 30 03:38:35 2016 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* vm_dump.c (backtrace): use rip in the saved context for the case
|
||||
|
|
8
io.c
8
io.c
|
@ -1533,6 +1533,10 @@ nogvl_fsync(void *ptr)
|
|||
{
|
||||
rb_io_t *fptr = ptr;
|
||||
|
||||
#ifdef _WIN32
|
||||
if (GetFileType((HANDLE)rb_w32_get_osfhandle(fptr->fd)) != FILE_TYPE_DISK)
|
||||
return 0;
|
||||
#endif
|
||||
return (VALUE)fsync(fptr->fd);
|
||||
}
|
||||
#endif
|
||||
|
@ -1935,6 +1939,10 @@ nogvl_fdatasync(void *ptr)
|
|||
{
|
||||
rb_io_t *fptr = ptr;
|
||||
|
||||
#ifdef _WIN32
|
||||
if (GetFileType((HANDLE)rb_w32_get_osfhandle(fptr->fd)) != FILE_TYPE_DISK)
|
||||
return 0;
|
||||
#endif
|
||||
return (VALUE)fdatasync(fptr->fd);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue