diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-03-22 07:26:42 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-03-22 07:26:42 +0000 |
| commit | bbc9eed034bb9fa7ee0ff1039ca8b9dbf1f92b50 (patch) | |
| tree | 8d1f8bb30c4092ea1c809a0f7bfe65bb0cd94d66 /process.c | |
| parent | 41124390979930ed09433d4dae3909868275a606 (diff) | |
| download | ruby-bbc9eed034bb9fa7ee0ff1039ca8b9dbf1f92b50.tar.gz ruby-bbc9eed034bb9fa7ee0ff1039ca8b9dbf1f92b50.tar.xz ruby-bbc9eed034bb9fa7ee0ff1039ca8b9dbf1f92b50.zip | |
* the VMS support patch submitted by Akiyoshi, Masamichi
<Masamichi.Akiyoshi@jp.compaq.com> is merged.
* eval.c (exec_under): changing ruby_class is OK, but should not
alter cbase.
* eval.c (yield_under_i): ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
| -rw-r--r-- | process.c | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -713,7 +713,7 @@ static VALUE rb_f_fork(obj) VALUE obj; { -#if !defined(__human68k__) && !defined(NT) && !defined(__MACOS__) && !defined(__EMX__) +#if !defined(__human68k__) && !defined(NT) && !defined(__MACOS__) && !defined(__EMX__) && !defined(__VMS) int pid; rb_secure(2); @@ -886,6 +886,30 @@ rb_f_system(argc, argv) last_status_set(status == -1 ? 127 : status); return status == 0 ? Qtrue : Qfalse; #else +#if defined(__VMS) + VALUE cmd; + int status; + + if (argc == 0) { + rb_last_status = Qnil; + rb_raise(rb_eArgError, "wrong number of arguments"); + } + + if (TYPE(argv[0]) == T_ARRAY) { + if (RARRAY(argv[0])->len != 2) { + rb_raise(rb_eArgError, "wrong first argument"); + } + argv[0] = RARRAY(argv[0])->ptr[0]; + } + cmd = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" ")); + + SafeStringValue(cmd); + status = system(RSTRING(cmd)->ptr); + last_status_set((status & 0xff) << 8); + + if (status == 0) return Qtrue; + return Qfalse; +#else volatile VALUE prog = 0; int pid; int i; @@ -938,6 +962,7 @@ rb_f_system(argc, argv) if (NUM2INT(rb_last_status) == 0) return Qtrue; return Qfalse; +#endif /* __VMS */ #endif /* __human68k__ */ #endif /* DJGPP */ #endif /* NT */ |
