diff options
-rw-r--r-- | src/scripts.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scripts.c b/src/scripts.c index f8f02d4f..f2e3eab8 100644 --- a/src/scripts.c +++ b/src/scripts.c @@ -3227,8 +3227,8 @@ system_spawn(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, siz } if (pipe_stdin != NULL && infd != -1) { - if (write(infd, pipe_stdin, strlen(pipe_stdin)) != -1) - write(infd, "\n", 1); + if (write(infd, pipe_stdin, strlen(pipe_stdin)) == -1 || write(infd, "\n", 1) == -1) + perror("system.spawn"); } if (infd != -1) close(infd); |