From dab261c6941e1ee04d823effdf65784f1a554cb8 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 6 Aug 2023 01:06:19 +0200 Subject: 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. --- src/Common/SCardLoader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Common') diff --git a/src/Common/SCardLoader.cpp b/src/Common/SCardLoader.cpp index ff3c9100..16026e62 100644 --- a/src/Common/SCardLoader.cpp +++ b/src/Common/SCardLoader.cpp @@ -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) { -- cgit v1.2.3