lli: Check pipe creation for errors.
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 4 Oct 2013 19:10:03 +0000 (19:10 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 4 Oct 2013 19:10:03 +0000 (19:10 +0000)
This is unlikely to ever fail, but ubuntu GCC warns when the return value is
unused.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191973 91177308-0d34-0410-b5e6-96231b3b80d8

tools/lli/Unix/RemoteTargetExternal.inc

index f1c3badb2f50821df9dd799f4c20a37ebefa6455..e245f7e3a816a5ae3d2c647121e2090febc85eea 100644 (file)
@@ -34,8 +34,9 @@ void RemoteTargetExternal::create() {
   int PipeFD[2][2];
   pid_t ChildPID;
 
-  pipe(PipeFD[0]);
-  pipe(PipeFD[1]);
+  // Create two pipes.
+  if (pipe(PipeFD[0]) != 0 || pipe(PipeFD[1]) != 0)
+    perror("Error creating pipe: ");
 
   ChildPID = fork();