mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-18 21:55:12 -04:00
Fixed: Don't fail if ldd doesn't exist
This commit is contained in:
@@ -109,18 +109,31 @@ namespace NzbDrone.Common.EnvironmentInfo
|
|||||||
|
|
||||||
private static string RunAndCapture(string filename, string args)
|
private static string RunAndCapture(string filename, string args)
|
||||||
{
|
{
|
||||||
Process p = new Process();
|
var processStartInfo = new ProcessStartInfo
|
||||||
p.StartInfo.FileName = filename;
|
{
|
||||||
p.StartInfo.Arguments = args;
|
FileName = filename,
|
||||||
p.StartInfo.UseShellExecute = false;
|
Arguments = args,
|
||||||
p.StartInfo.CreateNoWindow = true;
|
UseShellExecute = false,
|
||||||
p.StartInfo.RedirectStandardOutput = true;
|
CreateNoWindow = true,
|
||||||
|
RedirectStandardOutput = true
|
||||||
|
};
|
||||||
|
|
||||||
p.Start();
|
var output = string.Empty;
|
||||||
|
|
||||||
// To avoid deadlocks, always read the output stream first and then wait.
|
try
|
||||||
string output = p.StandardOutput.ReadToEnd();
|
{
|
||||||
p.WaitForExit(1000);
|
using (var p = Process.Start(processStartInfo))
|
||||||
|
{
|
||||||
|
// To avoid deadlocks, always read the output stream first and then wait.
|
||||||
|
output = p.StandardOutput.ReadToEnd();
|
||||||
|
|
||||||
|
p.WaitForExit(1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
output = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user