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

232 Коммитов

Автор SHA1 Сообщение Дата
usa 32c63d1f35 * win32/win32.c (poll_child_status): set EINVAL to errno when
GetExitCodeProcess() fails with ERROR_INVALID_HANDLE.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-18 09:10:04 +00:00
usa 62617789ed * win32/win32.c (CreateChild): no need to inherit handles here because
spawn'ed child cannot detect that STDIN is closed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-17 08:31:41 +00:00
nobu 7c5e3348f7 * suppress warnings on cygwin, mingw and mswin.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-01 19:55:25 +00:00
usa 9416fedc28 * process.c, include/ruby/intern.h (rb_run_exec_options): externed.
* process.c (save_redirect_fd, save_env_i, save_env, run_exec_dup2,
	  run_exec_open, run_exec_pgroup, run_exec_rlimit, rb_run_exec_options):
	  save parent's process environments.
	  !!!remark!!! these are not thread-safe.

	* process.c (rb_spawn_internal): remove calling run_exec_options()
	  because cannot restore after spawn. we'll fix this later.

	* io.c (pipe_open): ditto.

	* test/ruby/test_process.rb (test_execopts_env): upcase environment
	  variable name for case insensitive platforms.

	* win32/win32.c (init_env): set USER environment variable only when
	  USERNAME is available.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-12 14:15:32 +00:00
nobu 99b9eaaa68 * win32/win32.c (rb_w32_map_errno): exported.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-20 14:55:21 +00:00
usa cae4fb76dc * include/ruby/win32.h win32/win32.c (rb_w32_pipe_exec): use dual fd
instead of socketpair when mode is RDWR.

	* io.c (pipe_open): pass &write_fd to rb_w32_pipe_exec().

	* io.c (popen_redirect): define only when HAVE_FORK.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-20 04:04:51 +00:00
usa 50c7751b60 * win32/win32.c (init_env): refactoring. remove unused code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-02 11:17:23 +00:00
nobu 400202f6a5 * main.c (main): use platform-independent per-process initialization.
[ruby-dev:31900]

* ruby.c (ruby_sysinit): new function for per-process initialization.

* include/ruby/ruby.h (RUBY_GLOBAL_SETUP): toplevel setup declaration.

* include/ruby/win32.h, win32/mkexports.rb: alias NtInitialize
  ruby_sysinit.

* win32/win32.c (rb_w32_sysinit): renamed from NtInitialize.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-29 08:45:24 +00:00
nobu 92cad4305b * bcc32/{Makefile.sub,configure.bat,setup.mak: configure_args
support.

* bcc32/setup.mak: check runtime version.

* win32/win32.c (rb_w32_open_osfhandle): prototype has changed
  in bcc 5.82.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-21 08:32:34 +00:00
nobu cba32dcaa6 * ext/dl/cfunc.c (rb_dlcfunc_call): adjust format. [ruby-dev:31222]
* ext/digest/digest.c (rb_digest_instance_update,
  rb_digest_instance_finish, rb_digest_instance_reset,
  rb_digest_instance_block_length): %s in rb_raise() expects char*.
  [ruby-dev:31222]

* ext/openssl/ossl.h: include ossl_pkcs5.h.  [ruby-dev:31231]

* ext/openssl/ossl_pkcs5.h: new file for PKCS5.  [ruby-dev:31231]

* ext/openssl/ossl_x509name.c (ossl_x509name_to_s): use ossl_raise()
  instead of rb_raise().  [ruby-dev:31222]

* ext/sdbm/_sdbm.c: DOSISH platforms need io.h.  [ruby-dev:31232]

* ext/syck/syck.h: include stdlib.h for malloc() and free().
  [ruby-dev:31232]

* ext/syck/syck.h (syck_parser_set_input_type): prototype added.
  [ruby-dev:31231]

* win32/win32.c: include mbstring.h for _mbspbrk().  [ruby-dev:31232]

* include/ruby/win32.h (rb_w32_getcwd): prototype added.
  [ruby-dev:31232]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-15 13:24:39 +00:00
nobu 9dbaa0a9a9 * win32/win32.c (CreateChild): enclose command line except for
command.com which can not handle quotes.  [ruby-talk:258939]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-13 06:02:18 +00:00
usa cd72ed32cc * win32/win32.c: remove unused functions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-27 14:52:00 +00:00
usa 1aa54c6db6 * include/ruby/win32.h, win32/Makefile.sub, win32/configure.bat,
win32/mkexports.rb, win32/setup.mak, win32/win32.c: import
	  x64-mswin64 port.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-27 11:47:53 +00:00
nobu 2b592580bf * include/ruby: moved public headers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-10 03:06:15 +00:00
nobu 82159c813b * win32/win32.c (rb_w32_opendir): removed duplicated code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-29 03:30:14 +00:00
nobu d15b7d0509 * win32/win32.c (rb_w32_opendir, rb_w32_readdir): eliminate magic
numbers.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-29 01:53:14 +00:00
usa 216dcd80ff * win32/win32.c (init_stdhandle): stderr should be without buffering,
but mswin32 use buffering when stderr is not connected to tty.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-15 06:01:33 +00:00
usa fb853dc2c2 * win32/win32.c (NtInitialize, exit_handler): add initializing and
cleanup of critical section object for select.

	* win32/win32.c (do_select): block reentrance.

	* win32/win32.c (rb_w32_select): 0 sec polling of socket. this is
	  workaround because winsock cannot do select at same socket at the
	  same time by two or more threads.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-25 06:28:20 +00:00
usa 314734add8 * win32/win32.[ch] (rb_w32_enter_critical, rb_w32_leave_critical): no
need to reject reentrance. removed.

	* rubysig.h (RUBY_CRITICAL): follow above changes.

	* rubysig.h (TRAP_BEG, TRAP_END): no need to save errno.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-11 07:37:02 +00:00
usa 20e961458e * win32/win32.c (rb_w32_fclose, rb_w32_close): need to save errno
before calling original fclose()/close().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-10 08:02:38 +00:00
usa 1486959550 * thread.c (do_select): use ubf_select() as UBF on windows.
* win32/win32.c (do_select): shouldn't call catch_interrupt() here.
	  fixed: [ruby-dev:30674], reported by wanabe.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-09 09:29:45 +00:00
usa 528e8517b8 * win32/win32.c (rb_w32_cmdvector): fixed buffer size. reported by
wanabe [ruby-dev:30672]

	* win32/win32.c (init_env, insert, rb_w32_get_environ): use strdup
	  instead of malloc + strlcpy. suggested by nobu [ruby-dev:30673]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-30 02:50:58 +00:00
usa 240f1279aa * win32/win32.c (init_env, insert, cmdglob, rb_w32_cmdvector,
rb_w32_opendir, rb_w32_readdir, rb_w32_strerror, rb_w32_stati64,
	  rb_w32_get_environ): use strlcpy() and strlcat().

	* win32/win32.c (rb_w32_opendir): use realloc() instead of xrealloc().

	* win32/win32.c (rb_w32_closedir): check NULL before free pointers.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-23 02:30:53 +00:00
usa f3cde2b5fb * win32/dir.h, win32/win32.c (rb_w32_opendir, rb_w32_readdir,
rb_w32_closedir): get rid of possible buffer-overflows.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-17 23:42:00 +00:00
nobu da3558fddb * parse.y (parser_yylex), win32/win32.c (rb_w32_utime): fixed
indentation broken at YARV merger.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-04 16:36:36 +00:00
nobu 8ac59769bc * file.c (rb_thread_flock, rb_file_flock): use UBF feature.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 09:45:41 +00:00
nobu c034fce5ce * process.c (rb_waitpid_blocking, rb_waitpid): use UBF feature.
* thread_win32.ci (rb_w32_wait_events_blocking): blocking version.

* win32/win32.c (waitpid): use rb_w32_wait_events_blocking().




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 09:43:40 +00:00
usa 1930f14533 * win32/win32.c (StartSocket): remove unnecessary code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24 07:31:11 +00:00
usa bb022bed3a * thread.c (rb_thread_polling): check interrupts here.
* thread_win32.ci (w32_wait_events): rename from w32_wait_event(), and
  now receive multiple event handles.

* win32/win32.c (wait_events, rb_w32_main_context): removed.

* thread_win32.ci (rb_w32_wait_events): new function.

* thread_win32.ci, win32/win32.c (rb_w32_sleep, rb_w32_Sleep): move
  from win32/win32.c to thread_win32.ci, and use w32_wait_events().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-23 09:33:53 +00:00
usa 5834171904 * win32/win32.c (set_pioinfo_extra): simplified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-23 06:07:55 +00:00
nobu 562f256c54 * configure.in (pid_t, uid_t, gid_t): check if defined.
* intern.h, process.c, rubyio.h, ext/etc/etc.c, ext/pty/pty.c: use
  rb_{pid,uid,gid}_t instead of plain int.  [ruby-dev:30376]

* ext/etc/extconf.rb (PIDT2NUM, NUM2PIDT, UIDT2NUM, NUM2UIDT, GIDT2NUM,
  NUM2GIDT): moved to configure.in.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-18 04:13:09 +00:00
usa 691b6fb869 * win32/win32.c (get_pioinfo_extra): new function for VC++8 SP1
workaround. [ruby-core:10259]

* win32/win32.c (NtInitialize): call above function.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-15 11:50:28 +00:00
ko1 27172b8e6f * intern.h: prepare rb_last_status_get() and rb_last_status_set().
Use these functions instead of rb_last_status ([ruby-dev:30264]).
* process.c: define above functions.
* ext/pty/pty.c: use above functins.
* io.c (pipe_finalize): ditto.
* process.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-05 16:22:38 +00:00
ko1 a3e1b1ce7e * Merge YARV
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-12-31 15:02:22 +00:00
nobu 4abaf3a579 * win32/win32.c (init_stdhandle): redirect unopened IOs to NUL.
[ruby-core:09572]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-12-06 14:58:46 +00:00
nobu 66d43b5fd6 * dir.c (glob_helper): get rid of possible memory leak.
* win32/win32.c (cmdglob, rb_w32_cmdvector, rb_w32_opendir,
  rb_w32_get_environ): not to use GC before initialization.
  [ruby-core:09024]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-30 14:23:46 +00:00
nobu 450fc7bb57 * win32/win32.c (rb_w32_utime): allow NULL to set the current time.
[ruby-talk:219248]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-18 14:03:43 +00:00
nobu edcb8975ac * configure.in, bcc32/Makefile.sub, win32/Makefile.sub, win32/dir.h,
win32/win32.c, win32/win32.h: large file support for win32.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-12 06:56:09 +00:00
usa 2982c52892 * win32/win32.c (exit_handler): new function; release winsock and
environment work area.

* win32/win32.c (NTInitialize): setup exit_handler.

* win32/win32.c (StartSockets): use exit_handler.
  exit handler.

* win32/win32.c (rb_w32_getenv): use GetEnvironmentStrings() instead
  of GetEnvironmentVariable(), because the latter cannot distinguish
  wheather a null environment variable exists or not.
  fixed: [ruby-talk:205123]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-31 07:58:34 +00:00
usa 1921fbce45 * win32/win32.c (open_ifs_socket): should not use plain malloc.
* win32/win32.c (rb_w32_opendir): should not use plain realloc.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-18 14:13:07 +00:00
usa da617f7f79 * win32/win32.[ch] (rb_w32_read, rb_w32_write): new functions.
use recv() and send() when fd is socket. fixed: [ruby-dev:28694]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-08 05:01:51 +00:00
usa 301f4076f8 * win32/win32.c (errmap): add some winsock errors.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-07 05:53:46 +00:00
nobu da7472ee99 * win32/win32.c (rb_w32_cmdvector): backslashes inside single-quotes
no longer has special meanings.  fixed: [ruby-list:42311]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-01 10:13:41 +00:00
usa e4602e1d27 * win32/win32.c (rb_w32_getcwd): runtime's getcwd() will not success
if the length of the cwd is longer than MAX_PATH.
  fixed [ruby-list:42335]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-01 07:18:12 +00:00
usa f85ebe0963 * win32/win32.c (rb_w32_getcwd): set errno if not set.
fixed [ruby-list:42346]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-01 02:34:30 +00:00
ocean be70a6ebec * win32/win32.c (filetime_to_unixtime): should set tm_isdst to -1.
stat() didn't treat daylight saving time property on WinNT.
  [ruby-talk:182100]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-03-02 04:01:31 +00:00
usa 20f3ea3f6c * win32/win32.c (NtInitialize): need to set a handler for VC++8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-24 02:19:44 +00:00
usa f0ab5bdea2 * win32/win32.c (rb_w32_utime): drop read-only attribute before
changing file time.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-14 04:49:01 +00:00
usa f0432871fd * win32/win32.c (LK_ERR): ERROR_NOT_LOCKED is not an error.
In such situation, flock() should return 0.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-04 12:21:55 +00:00
ocean 88a3caaafe * win32/win32.c (rb_w32_seekdir): should not segfault even if passed
the location which rb_w32_telldir didn't return. (and should change
  `bits' position) [ruby-core:7035]

* win32/dir.h: ditto. (stores `loc' instead of `bitpos')

* test/ruby/test_dir.rb: added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-01-01 05:49:01 +00:00