Commit graph

208 commits

Author SHA1 Message Date
nobu
05bc15b0ec * win32/win32.c (init_stdhandle): assign standard file handles.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-01 08:44:44 +00:00
usa
eec1f2882e * 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/branches/ruby_1_8@10651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-31 08:09:01 +00:00
usa
45b085a0b2 * 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/branches/ruby_1_8@10562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-18 14:13:07 +00:00
usa
c52019ffe7 * win32/win32.[ch] (rb_w32_send, rb_w32_sendto): constified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-26 00:57:31 +00:00
usa
98f09b9618 * 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/branches/ruby_1_8@10233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-08 05:20:00 +00:00
usa
1ea51f02ec * win32/win32.c (errmap): add some winsock errors.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-07 05:53:46 +00:00
usa
4e19b0e00f * win32/{configure.bat, setup.mak, Makefile.sub, win32.h}: add
support new configure option `--with-winsock2'.

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

* ext/socket/extconf.rb: ditto.

* win32/win32.c (open_ifs_socket): new function.

* win32/win32.c (StartSockets, rb_w32_socket): use open_ifs_socket()
  instead of socket().
  ifs socket support is backported from trunk.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-07 01:51:47 +00:00
nobu
ae6dedc7f0 * 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/branches/ruby_1_8@10202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-01 10:13:41 +00:00
usa
02821cc038 * 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/branches/ruby_1_8@10201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-01 07:18:12 +00:00
usa
ee39e2578a * 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/branches/ruby_1_8@10199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-01 02:34:30 +00:00
ocean
8bd7f1ecc5 * 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/branches/ruby_1_8@10011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-03-02 04:01:31 +00:00
usa
d23d055d47 * time.c (time_new_internal): add prototype to tell the compiler
arugments types.

* win32/win32.c (NtInitialize): need to set a handler for VC++8.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-24 02:22:33 +00:00
usa
4b7ecb15d1 * time.c (search_time_t): support non 32bit time_t environments.
* win32/Makefile.sub (config.h): VC++8 has ``long long'' type.

* win32/Makefile.sub (config.h): VC++8's time_t is 64bit value.

* win32/win32.c (rb_w32_utime): drop read-only attribute before
  changing file time.

  all changes are backported from CVS HEAD.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-14 05:03:16 +00:00
usa
49a2b019f6 * 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/branches/ruby_1_8@9884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-04 12:21:55 +00:00
usa
b12d498a0a * win32/win32.c (ioinfo): revert previous commit. sorry.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-01-06 02:27:33 +00:00
usa
4f092ec3d0 * win32/win32.c (ioinfo): VC++8 support, forgotten to commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-01-05 10:05:08 +00:00
ocean
73a71e19c8 * win32/win32.c (rb_w32_seekdir): should not segfault even if passed
the location which rb_w32_telldir didn't return. [ruby-core:7035]

* test/ruby/test_dir.rb: added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-01-01 08:12:39 +00:00
usa
34664e81af * file.c (eaccess): workaround for VC++8 runtime.
* win32/win32.c (ioinfo): VC++8 support.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-29 19:55:58 +00:00
ocean
67ea4d0242 * win32/win32.c (rb_w32_strerror): remove all CR and LF. (avoid broken
error message on bccwin32 + winsock)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-28 04:24:26 +00:00
nobu
fff3548e04 * file.c (test_identical): test if two files are identical.
* file.c (rb_f_test): support DOSISH systems where st_ino is not
  reliable.  fixed: [ruby-core:06672]

* win32.h, win32.c (rb_w32_osid): check the running platform.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-22 16:26:39 +00:00
ocean
4dc782978d * win32/win32.c (winnt_stat): set mapped errno instead of ENOENT.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-22 09:42:09 +00:00
ocean
bb935564fd * win32/win32.c (rb_w32_stat): Dir.chdir('//server/shared');
p Dir.glob('*') should work on WinNT. (implemented our own
  stat(2) on WinNT) [ruby-list:41552] [ruby-dev:27711]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-22 04:21:01 +00:00
usa
45e155dbe5 * win32/win32.c (ioctl): should set errno.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-14 13:09:11 +00:00
nobu
14e256f4b1 * dir.c (ruby_glob): glob function not using ruby exception system.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-14 13:41:02 +00:00
ocean
4d11a486ae * win32/win32.c: just uniformed method style.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-08-05 04:19:22 +00:00
ocean
0661db665e * win32/win32.c (rb_w32_strerror): should return correct message
for ENAMETOOLONG and ENOTEMPTY. (bcc32) [ruby-dev:26533]

* win32/win32.c (rb_w32_strerror): stripped CR LF on the tail.
  (bcc32) [ruby-dev:26533]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-14 09:33:52 +00:00
ocean
d20bc9f4d2 * win32/win32.c (rb_w32_mkdir): should set EEXIST (not EACCES)
if file or directory already exists. (bcc32)

* win32/win32.c (rb_w32_rmdir): should set ENOTDIR (not EINVAL)
  if it is not directory. (bcc32, win32)

* win32/win32.c (rb_w32_rmdir, rb_w32_unlink): restore
  FILE_ATTRIBUTE_READONLY flag on function failure.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-13 10:40:06 +00:00
usa
8f8d7c1113 * ext/dbm/dbm.c (fdbm_closed): new method DBM#closed?
* ext/gdbm/gdbm.c (fgdbm_closed): new method GDBM#closed?

* ext/sdbm/init.c (fsdbm_closed): new method SDBM#closed?

* test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb, test/sdbm/test_sdbm.rb
  (teardown): close all db objects before deleting data files.

* win32/win32.{ch} (unlink): hook runtime function to change
  file attribute before unlinking.
  fixed: [ruby-dev:26360]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-20 07:53:22 +00:00
nobu
a5f61654e9 * dir.c (glob_helper): get rid of using String. [ruby-dev:26180]
* dir.c (push_braces): should skip balanced braces.

* eval.c (ruby_options), win32/win32.c (NtInitialize): move argument
  intialization back.  [ruby-dev:26180]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-18 14:39:27 +00:00
usa
3279381758 * win32/win32.c (unixtime_to_filetime): use localtime() instaed of
gmtime() when using FileLocalTimeToFileTime().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-17 02:52:43 +00:00
ocean
49e9468085 * win32/win32.{h,c}: define rb_{p,g,u}id_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-15 23:53:17 +00:00
nobu
ab59e8a6cc * win32/win32.c (unixtime_to_filetime): deal with DST.
[ruby-talk:141817]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-15 00:57:49 +00:00
nobu
7862a89c56 * configure.in: Check for the availability of pid_t, gid_t and uid_t and
remove AC_TYPE_UID_T.  fixed: [ruby-core:04745]

* defines.h: Remove pid_t typedef.

* ruby.h: Define rb_pid_t, rb_gid_t and rb_uid_t in accordance with
 the available system types.

* process.c: Change instances of pid_t and gid_t to their rb_*
 counterparts.

* ext/pty/pty.c: Change pid_t to rb_pid_t.

* vms/config.h: Define HAVE_{P,G,U}ID_T to 1.

* win32/Makefile.sub: Remove #define for {g,u}id_t.

* win32/win32.c: Change pid_t to rb_pid_t.

* wince/Makefile.sub: Remove #define for {g,u}id_t.

* wince/sys/types.h: Remove definitions of {p,g,u}id_t.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-14 14:57:53 +00:00
ocean
0338abee0e * win32/win32.{h,c} (rb_w32_fdopen): avoid warning on bcc32.
(backported from HEAD)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-04-03 08:26:43 +00:00
ocean
ca63c2c062 * dir.c (fnmatch): removed unnecessary code. (ruby_1_8 didn't have
String#clear, so [ruby-dev:24749] didn't affect it)

* win32/win32.c (NtInitialize): ditto. (by numeric.c 1.101.2.14)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-05 09:31:32 +00:00
usa
5fec853229 * {bcc32,win32,wince}/Makefile.sub (config.h): add fcntl.
* win32/win32.[ch] (fcntl): ditto.

* win32/win32.c (rb_w32_connect): support nonblocking mode.

* ext/socket/socket.c (wait_connectable, ruby_connect): support
  nonblocking connect on various platforms.
  all changes are backported from CVS HEAD. [ruby-core:3154],
  [ruby-core:4364].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-02-21 01:08:56 +00:00
usa
bf748365c7 * win32/win32.c (flock_winnt, flock_win95): unlock file even if
LOCK_NB is specified. (backported from CVS HEAD)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-26 01:53:02 +00:00
ocean
02ee8870d6 * win32/win32.c (rb_w32_close): didn't close socket handle.
* win32/win32.c (rb_w32_open_osfhandle): bcc32's _open_osfhandle
  never set EMFILE.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-06 11:05:31 +00:00
usa
525c8f80b2 * dir.c (dir_s_mkdir): win32 special processing doesn't need any
longer. (backported from CVS HEAD)

* win32/win32.[ch] (rb_w32_mkdir): new function. POSIX.1 compatible
  interface. (backported from CVS HEAD)

* win32/win32.[ch] (rb_w32_rmdir): new function. (backported from CVS
  HEAD)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-05 01:50:06 +00:00
ocean
f4960beffe * bcc32/Makefile.sub: bcc32 should use RTL dll (backport from HEAD)
[ruby-dev:25306]

* win32/win32.[ch]: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-24 14:52:25 +00:00
ocean
b35a261a79 * win32/win32.[ch]: failed to compile on bcc32 (and probably wince)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-24 09:40:34 +00:00
usa
8dac052af4 * win32/win32.[ch] (rb_w32_isatty): new function to replace MSVCRT's
isatty because it never sets errno. (backported from CVS HEAD)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-15 08:05:10 +00:00
usa
6f3923f29e * win32/win32.c (rb_w32_fdisset): check whether the handle is valid.
fixed: [ruby-core:03959]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-15 05:31:32 +00:00
usa
4785d53be1 * win32/win32.c (rb_w32_fdisset): rollback previous commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-15 04:07:53 +00:00
usa
9ccc9cfaf3 * win32/win32.c (rb_w32_fdisset): check whether fd is socket.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-15 02:06:26 +00:00
usa
9cd4987614 * win32/win32.c (rb_w32_close): need to reset osfhnd().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-14 08:10:32 +00:00
usa
2807bd47af * eval.c (run_trap_eval): prototype; avoid VC++ warnings.
* ext/socket/getaddrinfo.c: fix typo. fixed: [ruby-core:03947]

* win32/win32.c: need to include dln.h.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-11 03:44:40 +00:00
usa
c56fa330b2 * win32/win32.c (CreateChild): search executable file if no program
name given. (backported from CVS HEAD)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-29 05:00:29 +00:00
usa
518c3a3479 * win32/win32.c (CreateChild): push back the last space before next
loop because CharNext() eats it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-29 04:17:05 +00:00
usa
54c24dfc99 * eval.c (ruby_options): now we cannot call rb_glob() before
ruby_init(), so call rb_w32_cmdvector() at ruby_options().

* win32.{c,h} (rb_w32_cmdvector): rename make_cmdvector() and
  export it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-12 06:06:15 +00:00