summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Bolte <sbolte@lavabit.com>2013-06-02 11:11:49 +0200
committerStefan Bolte <sbolte@lavabit.com>2013-06-02 11:11:49 +0200
commit830cc13d85e4057d620195b6053ee38814275723 (patch)
treed6da9e97664810435fed682cc21ee2b1a62e495b
parent08200c630597b21d3cc6168082d34b0840e8bc5e (diff)
downloaddwb-830cc13d85e4057d620195b6053ee38814275723.zip
Check retrurn value of write in global_spawn
-rw-r--r--src/scripts.c4
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);