summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-06 04:30:27 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-06 04:30:27 +0000
commita8bb4ed57719a231d4a15bda964476b0b373d03c (patch)
tree97860f4f5b8b88e20718c5bb985b13691dc6803c /process.c
parent6a29dec1fde8d2d18bb3eb21f27ad45527d20734 (diff)
* process.c (proc_exec_v): follow to proc_spawn_v(). call do_aspawn()
on Win32. * process.c (rb_proc_exec): call do_spawn() on Win32. * win32/win32.c, win32/win32.h (do_spawn, do_aspawn): add mode flag. * process.c (proc_spawn_v, rb_f_system): follow above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/process.c b/process.c
index bdf4301..0866a09 100644
--- a/process.c
+++ b/process.c
@@ -441,17 +441,13 @@ proc_exec_v(argv, prog)
char **argv;
char *prog;
{
- if (prog) {
- security(prog);
- }
- else {
- security(argv[0]);
- prog = dln_find_exe(argv[0], 0);
- if (!prog) {
- errno = ENOENT;
- return -1;
- }
- }
+ if (!prog)
+ prog = argv[0];
+ security(prog);
+ prog = dln_find_exe(prog, 0);
+ if (!prog)
+ return -1;
+
#if (defined(MSDOS) && !defined(DJGPP)) || defined(__human68k__) || defined(__EMX__) || defined(OS2)
{
#if defined(__human68k__)
@@ -490,7 +486,11 @@ proc_exec_v(argv, prog)
}
#endif /* MSDOS or __human68k__ or __EMX__ */
before_exec();
+#ifdef _WIN32
+ do_aspawn(P_OVERLAY, prog, argv);
+#else
execv(prog, argv);
+#endif
after_exec();
return -1;
}
@@ -531,6 +531,11 @@ rb_proc_exec(str)
while (*str && ISSPACE(*str))
str++;
+#ifdef _WIN32
+ before_exec();
+ do_spawn(P_OVERLAY, (char *)str);
+ after_exec();
+#else
for (s=str; *s; s++) {
if (*s != ' ' && !ISALPHA(*s) && strchr("*?{}[]<>()~&|\\$;'`\"\n",*s)) {
#if defined(MSDOS)
@@ -574,6 +579,7 @@ rb_proc_exec(str)
return proc_exec_v(argv, 0);
}
errno = ENOENT;
+#endif /* _WIN32 */
return -1;
}
@@ -619,7 +625,7 @@ proc_spawn_v(argv, prog)
#endif
before_exec();
#if defined(_WIN32)
- status = do_aspawn(prog, argv);
+ status = do_aspawn(P_WAIT, prog, argv);
#else
status = spawnv(P_WAIT, prog, argv);
#endif
@@ -860,7 +866,7 @@ rb_f_system(argc, argv)
if (argc == 1 && prog == 0) {
#if defined(_WIN32)
- status = do_spawn(RSTRING(argv[0])->ptr);
+ status = do_spawn(P_WAIT, RSTRING(argv[0])->ptr);
#else
status = proc_spawn(argv[0]);
#endif