From 76e503ed7a6e8de6ac8cb1213eff332078b19d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Fri, 17 Feb 2017 17:04:10 +0100 Subject: [PATCH] run-program: if gray-stream passed, propose continuation If execution is continued, new stream is created. --- src/c/unixsys.d | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/c/unixsys.d b/src/c/unixsys.d index ef98fcfbb..eea56bb57 100644 --- a/src/c/unixsys.d +++ b/src/c/unixsys.d @@ -494,8 +494,11 @@ create_descriptor(cl_object stream, cl_object direction, HANDLE stream_handle = ecl_stream_to_HANDLE (stream, direction != @':input'); if (stream_handle == INVALID_HANDLE_VALUE) { - FEerror("~S argument to RUN-PROGRAM does not " - "have a file handle:~%~S", 2, direction, stream); + CEerror(make_constant_base_string("Create a new stream."), + "~S argument to RUN-PROGRAM does not have a file handle:~%~S", + 2, direction, stream); + create_descriptor(@':stream', direction, child, parent); + return; } DuplicateHandle(current, stream_handle, current, child, 0, TRUE, @@ -532,8 +535,11 @@ create_descriptor(cl_object stream, cl_object direction, if (*child >= 0) { *child = dup(*child); } else { - FEerror("~S argument to RUN-PROGRAM does not " - "have a file handle:~%~S", 2, direction, stream); + CEerror(make_constant_base_string("Create a new stream."), + "~S argument to RUN-PROGRAM does not have a file handle:~%~S", + 2, direction, stream); + create_descriptor(@':stream', direction, child, parent); + return; } } else {