зеркало из https://github.com/github/ruby.git
* process.c (rb_exec): prints error message only on platforms
neither close-on-exec nor spawnv is supported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
ba1a12170b
Коммит
f60de59a70
|
@ -1,3 +1,8 @@
|
|||
Sat Mar 21 08:19:52 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* process.c (rb_exec): prints error message only on platforms
|
||||
neither close-on-exec nor spawnv is supported.
|
||||
|
||||
Sat Mar 21 08:17:41 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* win32/win32.c (rb_w32_spawn, rb_w32_aspawn): omit program name
|
||||
|
|
21
process.c
21
process.c
|
@ -2336,19 +2336,28 @@ rb_exec_err(const struct rb_exec_arg *e, char *errmsg, size_t errmsg_buflen)
|
|||
else {
|
||||
rb_proc_exec_n(argc, argv, prog);
|
||||
}
|
||||
#ifndef FD_CLOEXEC
|
||||
preserving_errno({
|
||||
fprintf(stderr, "%s:%d: command not found: %s\n",
|
||||
rb_sourcefile(), rb_sourceline(), prog);
|
||||
});
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
rb_exec(const struct rb_exec_arg *e)
|
||||
{
|
||||
#if !defined FD_CLOEXEC && !defined HAVE_SPAWNV
|
||||
char errmsg[80] = { '\0' };
|
||||
int ret = rb_exec_err(e, errmsg, sizeof(errmsg));
|
||||
preserving_errno(
|
||||
if (errmsg[0]) {
|
||||
fprintf(stderr, "%s\n", errmsg);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "%s:%d: command not found: %s\n",
|
||||
rb_sourcefile(), rb_sourceline(), e->prog);
|
||||
}
|
||||
);
|
||||
return ret;
|
||||
#else
|
||||
return rb_exec_err(e, NULL, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAVE_FORK
|
||||
|
|
Загрузка…
Ссылка в новой задаче