* win32/win32.c (mypopen): return error status instead of calling
rb_sys_fail(). * win32/win32.c (do_spawn): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
beeda6eef0
commit
90ff4f01ab
@ -1,3 +1,10 @@
|
|||||||
|
Tue Nov 13 16:49:16 2001 Usaku Nakamura <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* win32/win32.c (mypopen): return error status instead of calling
|
||||||
|
rb_sys_fail().
|
||||||
|
|
||||||
|
* win32/win32.c (do_spawn): ditto.
|
||||||
|
|
||||||
Tue Nov 13 12:55:59 2001 Usaku Nakamura <usa@ruby-lang.org>
|
Tue Nov 13 12:55:59 2001 Usaku Nakamura <usa@ruby-lang.org>
|
||||||
|
|
||||||
* win32/win32.c (do_spawn): use CreateChild() instead of calling
|
* win32/win32.c (do_spawn): use CreateChild() instead of calling
|
||||||
|
@ -474,7 +474,7 @@ mypopen (char *cmd, char *mode)
|
|||||||
fRet = CreatePipe(&hInFile, &hOutFile, &sa, 2048L);
|
fRet = CreatePipe(&hInFile, &hOutFile, &sa, 2048L);
|
||||||
if (!fRet) {
|
if (!fRet) {
|
||||||
errno = GetLastError();
|
errno = GetLastError();
|
||||||
rb_sys_fail("mypopen: CreatePipe");
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reading) {
|
if (reading) {
|
||||||
@ -487,7 +487,7 @@ mypopen (char *cmd, char *mode)
|
|||||||
if (!child) {
|
if (!child) {
|
||||||
CloseHandle(hInFile);
|
CloseHandle(hInFile);
|
||||||
CloseHandle(hOutFile);
|
CloseHandle(hOutFile);
|
||||||
rb_sys_fail("mypopen: CreateChild");
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reading) {
|
if (reading) {
|
||||||
@ -502,13 +502,13 @@ mypopen (char *cmd, char *mode)
|
|||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
CloseHandle(reading ? hInFile : hOutFile);
|
CloseHandle(reading ? hInFile : hOutFile);
|
||||||
CloseChildHandle(child);
|
CloseChildHandle(child);
|
||||||
rb_sys_fail("mypopen: _open_osfhandle");
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((fp = (FILE *) fdopen(fd, mode)) == NULL) {
|
if ((fp = (FILE *) fdopen(fd, mode)) == NULL) {
|
||||||
_close(fd);
|
_close(fd);
|
||||||
CloseChildHandle(child);
|
CloseChildHandle(child);
|
||||||
rb_sys_fail("mypopen: fdopen");
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
child->pipe = fp;
|
child->pipe = fp;
|
||||||
@ -551,7 +551,7 @@ char *cmd;
|
|||||||
{
|
{
|
||||||
struct ChildRecord *child = CreateChild(cmd, NULL, NULL, NULL, NULL);
|
struct ChildRecord *child = CreateChild(cmd, NULL, NULL, NULL, NULL);
|
||||||
if (!child) {
|
if (!child) {
|
||||||
rb_sys_fail("do_spawn: CreateChild");
|
return -1;
|
||||||
}
|
}
|
||||||
rb_syswait(child->pid);
|
rb_syswait(child->pid);
|
||||||
return NUM2INT(rb_last_status);
|
return NUM2INT(rb_last_status);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user