Граф коммитов

612 Коммитов

Автор SHA1 Сообщение Дата
nobu f213f5044e win32.c: fallback to WCHAR-version in MSVCRT
* win32/win32.c (rb_w32_open): should not fallback to ANSI-version
  in MSVCRT, fallback to WCHAR-version in rb_w32_wopen instead.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-22 11:59:47 +00:00
nobu 70b2af3b21 win32.c: no xmalloc at sys_init
* win32/win32.c (rb_w32_sysinit, rb_w32_readdir): compare by
  encoding index to get rid of encoding initialization before VM
  object space allocation.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-15 06:15:44 +00:00
nobu 9c9d555e7f win32.c: encindex.h
* win32/win32.c: needs encindex.h for encoding indexes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-15 06:03:37 +00:00
nobu f6d77bf560 win32.c: fix dup2 return value
* win32/win32.c (rb_w32_dup2): should return the new fd on
  success, while msvcrt returns 0 wrongly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-12 10:09:03 +00:00
nobu f150a381db win32.c: more fcntl
* win32/win32.c (fcntl): implement F_GETFD, F_SETFD, and
  F_DUPFD_CLOEXEC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-12 05:23:22 +00:00
usa 49cbfc8359 * win32/win32.c (rb_w32_read_reparse_point): return correct required
buffer size for IO_REPARSE_TAG_MOUNT_POINT.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-08 03:06:10 +00:00
nobu 4e43e7ad0d win32.c: use plain strdup
* win32/win32.c (insert): should use plain strdup() instead of
  ruby_strdup() at startup time, and plain free()ed in cmdglob().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-07 13:05:31 +00:00
nobu 649016bdb1 win32.c: suppress a warning
* win32/win32.c (get_attr_vsn): assume GetLastError() never return
  0, to suppress a maybe-uninitialized warning in wrename().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-05 23:14:25 +00:00
nobu 6bbd9104cb win32: use ALLOCV
* win32/file.c (rb_readlink): use ALLOCV to get rid potential
  memory leak by NoMemoryError in ALLOCV.

* win32/win32.c (w32_readlink): allocate WCHAR path name and
  reparse buffer together.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-02 04:14:42 +00:00
nobu d93855e6ef win32.c: suppress warnings
* win32/win32.c (fchmod): put braces to suppress missing-braces
  warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-28 11:35:09 +00:00
nobu b072900780 win32.c: suppress warnings
* win32/win32.c (wrename): fix type of attributes to suppress
  warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-28 11:34:53 +00:00
nobu 262b10210f win32.c: fchmod
* win32/win32.c (fchmod): implement by using
  SetFileInformationByHandle.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-27 04:01:37 +00:00
nobu a2da0f7e42 win32.c: get attributes and VSN at once
* win32/win32.c (wrename): get attributes and VSN at once for each
  path names.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-27 03:58:10 +00:00
nobu f64d6357b6 win32.c: open_special
* win32/win32.c (open_special): extract to open existing file with
  backup semantics.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-27 03:57:56 +00:00
nobu b79d7910f5 win32.c: use backslashes
* win32/win32.c (w32_symlink): must use backslashes instead of
  slashes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-26 17:24:32 +00:00
nobu 8504c817e3 win32.c: ELOOP at wrename
* win32/win32.c (wrename): fail with ELOOP if failed to resolve
  the old path name.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-26 16:22:56 +00:00
nobu a25de2c6e1 win32.c: fix return value of reparse_symlink
* win32/win32.c (reparse_symlink): return raw Windows error code
  since r51676.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-26 16:01:48 +00:00
nobu 91f5ee89ef win32.c: unlink symlinkd
* win32/win32.c (wunlink): SYMLINKD has to be removed as a
  directory but not a file.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-26 14:46:29 +00:00
nobu 14ae6199bf win32.c: fix for old platforms
* win32/win32.c (open_dir_handle): fix for old platforms where
  GetFinalPathNameByHandleW is not supported.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-26 14:12:43 +00:00
nobu 8e6259e0d9 win32.c: find by final path
* win32/win32.c (open_dir_handle): find by final path name.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-26 08:11:33 +00:00
nobu dd67521bd1 win32.c: ELOOP by _wopen
* win32/win32.c (rb_w32_wopen): map the exact error for ELOOP when
  EINVAL is returned by _wopen of vc runtime.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-26 06:53:32 +00:00
nobu 597da7b2d0 win32.c: fake lchown
* win32/win32.c (lchown, rb_w32_ulchown): fake lchown.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-26 05:21:41 +00:00
nobu f4b66d24bb win32.c: ELOOP
* win32/win32.c (errmap): map ERROR_CANT_RESOLVE_FILENAME to
  ELOOP.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-26 04:47:37 +00:00
nobu 14aed229ea win32.c: fix offset
* win32/win32.c (opendir_internal): fix offset not to overwrite a
  backslash.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-25 05:11:35 +00:00
nobu 2f6fdd3aeb win32.c: rb_w32_reparse
* win32/win32.c (rb_w32_reparse): read reparse point in a dynamic
  buffer.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-25 05:11:19 +00:00
nobu 2e5c105ff2 win32.c: symlink
* win32/win32.c (w32_symlink): implement symlink().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-24 21:34:45 +00:00
nobu 457ca4dc29 win32.c: licenses
* win32/win32.c (rb_w32_wreadlink, rb_w32_wopen): add missing
  licenses.  [ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-24 08:55:09 +00:00
nobu 82da3da5ac win32.c: support known reparse points only
* dir.c (replace_real_basename), win32/win32.c (opendir_internal):
  check reparse point tags and treat supported tags only as
  symbolic links.  [ruby-core:70454] [Bug #11462]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-19 23:31:19 +00:00
nobu 006fad3fe3 win32.c: support known reparse points only
* win32/win32.c (winnt_lstat): check reparse point tags and treat
  supported tags only as symbolic links.
  [ruby-core:70454] [Bug #11462]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-19 14:48:09 +00:00
nobu 3c402604db win32.c: use ruby_strdup
* win32/win32.c (getifaddrs): use ruby_strdup instead of
  combination ruby_xmalloc, lstrlen and lstrcpy.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-10 05:19:25 +00:00
nobu 613d97c525 win32.c: symlink constants fallback
* win32/win32.c (rb_w32_wreadlink): define symlink constants for
  VC6.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21 10:51:56 +00:00
usa b3544b2551 * win32/win32.c (waitpid): fixed return value of previous commit. thanks, nobu!
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-09 06:38:16 +00:00
usa fcb79d5324 * win32/win32.c (waitpid): return immediately if interrupted.
reported by <takkanm AT gmail.com> [ruby-dev:49176] [Bug #11340]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-09 06:10:47 +00:00
nobu a2cd78a559 win32.c: use numberof
* win32/win32.c (open_dir_handle): use numberof() macro.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-22 00:21:34 +00:00
naruse 4ff07119e9 * file.c (rb_stat_ino): get inode from the interval of struct st.
* win32/win32.c (stati64_set_inode): get nFilIndexHigh/Low, and set it
  to the interval of struct st as inode.

* win32/win32.c (stati64_set_inode_handle): call stati64_set_inode.

* win32/win32.c (rb_w32_fstati64): call stati64_set_inode_handle.

* win32/win32.c (stati64_handle): call stati64_set_inode.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-13 11:46:38 +00:00
usa 2bc2802096 * file.c (File::SHARE_DELETE): new flag to be able to delete opened file
on Windows.

* include/win32/win32.c (O_SHARE_DELETE): new pseudo file mode flag.

* win32/win32.c (rb_w32_{w,}open): support above flag.  [EXPERIMENTAL]

* NEWS: mention about this feature.
  [Feature #11218] [ruby-dev:49022]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-12 12:14:06 +00:00
naruse d4bafbb45f * win32/win32.c (setup_overlapped): seek to the file end only when
writing (mode:a), not reading (mode:a+, read).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-25 02:35:31 +00:00
nobu 8b5ffc3683 win32.c: suppress a warning
* win32/win32.c (rb_w32_write_console): fix the type to suppress a
  warning of difference in signedness.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-23 11:07:18 +00:00
usa 7ceb9ecc31 * win32/win32.c (rb_w32_write_console): should return the count of
actually eaten characters, include escape sequences.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-22 18:13:32 +00:00
usa 3f4aab1621 * win32/win32.c (constat_apply): fixed comment. [skip ci]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-22 17:37:15 +00:00
nobu c4d216793b intern.h: rb_f_notimplement for ext on Windows
* include/ruby/intern.h (rb_f_notimplement): should not respond to
  not-implemented methods.  as the address inside a DLL and the
  imported address are different on Windows, use an exported
  variable to share the same address.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-18 06:31:42 +00:00
usa 4eb4f1fd7e * win32/win32.c (rb_w32_accept): simplified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-16 11:00:07 +00:00
usa 347d44ca41 * win32/win32.c: restore a license comment accidentally removed at r50381.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-24 14:48:24 +00:00
nobu d6d393d268 win32.c: fix for mingw
* win32/win32.c (_pioinfo): necessary on mingw too.

* win32/win32.c (init_stdhandle): remove stale function for
  Borland C.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-24 04:16:13 +00:00
usa c15a74f3d0 * win32/win32.c (rb_w32_{getc,putc}): removed. they are needed for old
ruby (before 1.8), but not now.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-24 01:44:12 +00:00
naruse 7bf5ba1b49 * win32/win32.c: remove bcc related code.
* include/ruby/win32.h: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-23 23:41:16 +00:00
naruse 9892a4b1ae * win32/win32.c (rb_acrt_lowio_lock_fh): wrap _pioinfo(i)->lock.
* win32/win32.c (rb_acrt_lowio_unlock_fh): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-23 23:41:10 +00:00
naruse 3446537f1a * win32/win32.c (_filbuf): msvc14 doesn't have it, use _fgetc_nolock.
* win32/win32.c (_flsbuf): msvc14 doesn't have it, use _fputc_nolock.

* win32/win32.c (vcruntime_file): define vcruntime_file on msvc14
  because it doesn't export FILE's internal structure.

* win32/win32.c (FILE_COUNT): added to abstract FILE->_cnt.

* win32/win32.c (FILE_READPTR): added to abstract FILE->_ptr.

* win32/win32.c (FILE_FILENO): added to abstract FILE->_file.

* win32/win32.c (init_stdhandle): use FILE_FILENO.

* win32/win32.c (rb_w32_getc): use FILE_COUNT and FILE_READPTR.

* win32/win32.c (rb_w32_putc): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-23 22:58:11 +00:00
naruse cc622e2ac5 * win32/win32.c (dupfd): use _set_osfhnd.
* win32/win32.c (rb_w32_wopen): use _set_osflags.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-23 22:58:05 +00:00
usa b38a8d287c * win32/win32.c (rb_w32_wreadlink): follow the official format of
REPARSE_DATA_BUFFER structure.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-20 14:48:09 +00:00