Linux: capture both stdout and stderr in popen call to avoid printing anything

If an error happens, error message will be read from popen pipe and so
libpcsclite.so will not be found. This is the same outcome as when
stdout is empty.
This commit is contained in:
Mounir IDRASSI 2023-08-06 01:06:19 +02:00
parent 16bb1de3a6
commit dab261c694
No known key found for this signature in database
GPG Key ID: FC1B00364B3FE937
1 changed files with 2 additions and 2 deletions

View File

@ -82,9 +82,9 @@ namespace VeraCrypt
string pcscPath = "";
FILE* pipe =
#ifdef TC_LINUX
popen("ldconfig -p", "r");
popen("ldconfig -p 2>&1", "r");
#else
popen("ldconfig -r", "r"); // FreeBSD
popen("ldconfig -r 2>&1", "r"); // FreeBSD
#endif
if (pipe)
{