* io.c (pipe_open): fix for win32 platforms.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
81201b4007
commit
819619495a
@ -1,3 +1,7 @@
|
|||||||
|
Tue Aug 7 12:31:51 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* io.c (pipe_open): fix for win32 platforms.
|
||||||
|
|
||||||
Tue Aug 7 02:58:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Tue Aug 7 02:58:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* bignum.c (rb_big2str0): make Bignum#to_s even faster. a patch
|
* bignum.c (rb_big2str0): make Bignum#to_s even faster. a patch
|
||||||
|
9
io.c
9
io.c
@ -3061,7 +3061,7 @@ pipe_open(const char *cmd, int argc, VALUE *argv, const char *mode)
|
|||||||
struct popen_arg arg;
|
struct popen_arg arg;
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
int openmode = rb_io_mode_modenum(mode);
|
int openmode = rb_io_mode_modenum(mode);
|
||||||
char *exename = NULL;
|
const char *exename = NULL;
|
||||||
#endif
|
#endif
|
||||||
FILE *fp = 0;
|
FILE *fp = 0;
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
@ -3135,9 +3135,8 @@ pipe_open(const char *cmd, int argc, VALUE *argv, const char *mode)
|
|||||||
args[i] = RSTRING_PTR(argv[i]);
|
args[i] = RSTRING_PTR(argv[i]);
|
||||||
}
|
}
|
||||||
args[i] = NULL;
|
args[i] = NULL;
|
||||||
cmd = ALLOCA_N(char, rb_w32_argv_size(args));
|
exename = cmd;
|
||||||
rb_w32_join_argv(cmd, args);
|
cmd = rb_w32_join_argv(ALLOCA_N(char, rb_w32_argv_size(args)), args);
|
||||||
exename = RSTRING_PTR(prog);
|
|
||||||
}
|
}
|
||||||
while ((pid = rb_w32_pipe_exec(cmd, exename, openmode, &fd)) == -1) {
|
while ((pid = rb_w32_pipe_exec(cmd, exename, openmode, &fd)) == -1) {
|
||||||
/* exec failed */
|
/* exec failed */
|
||||||
@ -3149,7 +3148,7 @@ pipe_open(const char *cmd, int argc, VALUE *argv, const char *mode)
|
|||||||
rb_thread_sleep(1);
|
rb_thread_sleep(1);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
rb_sys_fail(RSTRING_PTR(prog));
|
rb_sys_fail(cmd);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user