VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Platform/Unix/Process.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Platform/Unix/Process.cpp')
-rw-r--r--src/Platform/Unix/Process.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Platform/Unix/Process.cpp b/src/Platform/Unix/Process.cpp
index 36b01e6b..46b14a1e 100644
--- a/src/Platform/Unix/Process.cpp
+++ b/src/Platform/Unix/Process.cpp
@@ -147,59 +147,59 @@ namespace VeraCrypt
stdOutput.insert (stdOutput.end(), buffer.begin(), buffer.begin() + bytesRead);
else if (fd == errPipe.GetReadFD())
errOutput.insert (errOutput.end(), buffer.begin(), buffer.begin() + bytesRead);
else if (fd == exceptionPipe.GetReadFD())
exOutput.insert (exOutput.end(), buffer.begin(), buffer.begin() + bytesRead);
}
}
if (bytesRead == 0)
{
waitRes = waitpid (forkedPid, &status, 0);
break;
}
}
catch (TimeOut&)
{
timeTaken += pollTimeout;
if (timeOut >= 0 && timeTaken >= timeOut)
throw;
}
} while ((waitRes = waitpid (forkedPid, &status, WNOHANG)) == 0);
throw_sys_if (waitRes == -1);
if (!exOutput.empty())
{
unique_ptr <Serializable> deserializedObject;
Exception *deserializedException = nullptr;
try
{
- shared_ptr <Stream> stream (new MemoryStream (ConstBufferPtr ((byte *) &exOutput[0], exOutput.size())));
+ shared_ptr <Stream> stream (new MemoryStream (ConstBufferPtr ((uint8 *) &exOutput[0], exOutput.size())));
deserializedObject.reset (Serializable::DeserializeNew (stream));
deserializedException = dynamic_cast <Exception*> (deserializedObject.get());
}
catch (...) { }
if (deserializedException)
deserializedException->Throw();
}
int exitCode = (WIFEXITED (status) ? WEXITSTATUS (status) : 1);
if (exitCode != 0)
{
string strErrOutput;
if (!errOutput.empty())
strErrOutput.insert (strErrOutput.begin(), errOutput.begin(), errOutput.end());
throw ExecutedProcessFailed (SRC_POS, processName, exitCode, strErrOutput);
}
string strOutput;
if (!stdOutput.empty())
strOutput.insert (strOutput.begin(), stdOutput.begin(), stdOutput.end());
return strOutput;
}
}