From f2622fefe29de31778c3c61d0acf17d4c2e7994c Mon Sep 17 00:00:00 2001 From: shyouhei Date: Tue, 22 May 2007 16:28:10 +0000 Subject: merge -r 12143:12147 git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_6@12313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ error.c | 2 +- io.c | 30 +++++++++++++++++++----------- version.h | 2 +- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 15b4431ce..d2ecb547e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed May 23 01:28:14 2007 Nobuyoshi Nakada + + * error.c (rb_notimplement), io.c (pipe_open): removed definite + articles and UNIX manual section from messages. [ruby-dev:30690] + + * io.c (pipe_open): raise NotImplementedError for command "-" on + platforms where fork(2) is not available. [ruby-dev:30681] + Wed May 23 00:03:42 2007 NAKAMURA Usaku * ext/socket/socket.c (s_recv, s_recvfrom): some systems (such as diff --git a/error.c b/error.c index 1b23d433c..44e709276 100644 --- a/error.c +++ b/error.c @@ -1083,7 +1083,7 @@ void rb_notimplement() { rb_raise(rb_eNotImpError, - "the %s() function is unimplemented on this machine", + "%s() function is unimplemented on this machine", rb_id2name(ruby_frame->last_func)); } diff --git a/io.c b/io.c index fe24def3c..8f8dfcdf2 100644 --- a/io.c +++ b/io.c @@ -3026,11 +3026,29 @@ pipe_open(pstr, pname, mode) { int modef = rb_io_mode_flags(mode); OpenFile *fptr; - #if defined(DJGPP) || defined(__human68k__) || defined(__VMS) FILE *f; +#else + int pid; +#ifdef _WIN32 + FILE *fpr, *fpw; +#else + int pr[2], pw[2]; +#endif +#endif + volatile int doexec; if (!pname) pname = StringValueCStr(pstr); + doexec = (strcmp("-", pname) != 0); + +#if defined(DJGPP) || defined(__human68k__) || defined(__VMS) || defined(_WIN32) + if (!doexec) { + rb_raise(rb_eNotImpError, + "fork() function is unimplemented on this machine"); + } +#endif + +#if defined(DJGPP) || defined(__human68k__) || defined(__VMS) f = popen(pname, mode); if (!f) rb_sys_fail(pname); @@ -3052,10 +3070,6 @@ pipe_open(pstr, pname, mode) } #else #ifdef _WIN32 - int pid; - FILE *fpr, *fpw; - - if (!pname) pname = StringValueCStr(pstr); retry: pid = pipe_exec(pname, rb_io_mode_modenum(mode), &fpr, &fpw); if (pid == -1) { /* exec failed */ @@ -3085,16 +3099,10 @@ retry: return (VALUE)port; } #else - int pid, pr[2], pw[2]; - volatile int doexec; - - if (!pname) pname = StringValueCStr(pstr); - if (((modef & FMODE_READABLE) && pipe(pr) == -1) || ((modef & FMODE_WRITABLE) && pipe(pw) == -1)) rb_sys_fail(pname); - doexec = (strcmp("-", pname) != 0); if (!doexec) { fflush(stdin); /* is it really needed? */ fflush(stdout); diff --git a/version.h b/version.h index 3e516a6c2..b512244e3 100644 --- a/version.h +++ b/version.h @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2007-05-23" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20070523 -#define RUBY_PATCHLEVEL 9 +#define RUBY_PATCHLEVEL 10 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 -- cgit