mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-09 02:33:14 -08:00
ext:run-program looks into *standard-input/output* and *error-output* also under Win32.
This commit is contained in:
parent
5063c1c017
commit
486424543c
2 changed files with 25 additions and 10 deletions
|
|
@ -47,6 +47,9 @@ ECL 0.9g
|
|||
|
||||
- The random number generator assumed 32-bit integers.
|
||||
|
||||
- ext:run-program looks into *standard-input/output* and *error-output* for handle
|
||||
duplicatio also under Win32.
|
||||
|
||||
* ANSI compatibility:
|
||||
|
||||
- Several functions that signaled type-errors did not set the right values
|
||||
|
|
|
|||
|
|
@ -175,9 +175,13 @@ stream_to_handle(cl_object s, bool output)
|
|||
/* The child inherits a duplicate of our input
|
||||
handle. Creating a duplicate avoids problems when
|
||||
the child closes it */
|
||||
DuplicateHandle(current, GetStdHandle(STD_INPUT_HANDLE),
|
||||
current, &child_stdin, 0, TRUE,
|
||||
DUPLICATE_SAME_ACCESS);
|
||||
int stream_handle = stream_to_handle(SYM_VAL(@'*standard-input*'), 0);
|
||||
if (stream_handle >= 0)
|
||||
DuplicateHandle(current, _get_osfhandle(stream_handle) /*GetStdHandle(STD_INPUT_HANDLE)*/,
|
||||
current, &child_stdin, 0, TRUE,
|
||||
DUPLICATE_SAME_ACCESS);
|
||||
else
|
||||
child_stdin = NULL;
|
||||
} else {
|
||||
child_stdin = NULL;
|
||||
/*child_stdin = open("/dev/null", O_RDONLY);*/
|
||||
|
|
@ -203,9 +207,13 @@ stream_to_handle(cl_object s, bool output)
|
|||
/* The child inherits a duplicate of our output
|
||||
handle. Creating a duplicate avoids problems when
|
||||
the child closes it */
|
||||
DuplicateHandle(current, GetStdHandle(STD_OUTPUT_HANDLE),
|
||||
current, &child_stdout, 0, TRUE,
|
||||
DUPLICATE_SAME_ACCESS);
|
||||
int stream_handle = stream_to_handle(SYM_VAL(@'*standard-output*'), 1);
|
||||
if (stream_handle >= 0)
|
||||
DuplicateHandle(current, _get_osfhandle(stream_handle) /*GetStdHandle(STD_OUTPUT_HANDLE)*/,
|
||||
current, &child_stdout, 0, TRUE,
|
||||
DUPLICATE_SAME_ACCESS);
|
||||
else
|
||||
child_stdout = NULL;
|
||||
} else {
|
||||
child_stdout = NULL;
|
||||
/*child_stdout = open("/dev/null", O_WRONLY);*/
|
||||
|
|
@ -220,9 +228,13 @@ stream_to_handle(cl_object s, bool output)
|
|||
/* The child inherits a duplicate of our output
|
||||
handle. Creating a duplicate avoids problems when
|
||||
the child closes it */
|
||||
DuplicateHandle(current, GetStdHandle(STD_ERROR_HANDLE),
|
||||
current, &child_stderr, 0, TRUE,
|
||||
DUPLICATE_SAME_ACCESS);
|
||||
int stream_handle = stream_to_handle(SYM_VAL(@'*error-output*'), 1);
|
||||
if (stream_handle >= 0)
|
||||
DuplicateHandle(current, _get_osfhandle(stream_handle) /*GetStdHandle(STD_ERROR_HANDLE)*/,
|
||||
current, &child_stderr, 0, TRUE,
|
||||
DUPLICATE_SAME_ACCESS);
|
||||
else
|
||||
child_stderr = NULL;
|
||||
} else {
|
||||
child_stderr = NULL;
|
||||
/*child_stderr = open("/dev/null", O_WRONLY);*/
|
||||
|
|
@ -240,7 +252,7 @@ stream_to_handle(cl_object s, bool output)
|
|||
NULL, NULL, /* lpProcess/ThreadAttributes */
|
||||
TRUE, /* Inherit handles (for files) */
|
||||
/*CREATE_NEW_CONSOLE |*/
|
||||
0,
|
||||
0 /*(input == Ct || output == Ct || error == Ct ? 0 : CREATE_NO_WINDOW)*/,
|
||||
NULL, /* Inherit environment */
|
||||
NULL, /* Current directory */
|
||||
&st_info, /* Startup info */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue