From f1a6e237347bb15cdaf80a88b543fc8b5fa0a141 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 21 Jun 2026 18:07:12 +0900 Subject: [PATCH] Unix: make Pipe::Close idempotent --- src/Platform/Unix/Pipe.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Platform/Unix/Pipe.cpp b/src/Platform/Unix/Pipe.cpp index 7b2950ff..bdae238d 100644 --- a/src/Platform/Unix/Pipe.cpp +++ b/src/Platform/Unix/Pipe.cpp @@ -36,9 +36,15 @@ namespace VeraCrypt void Pipe::Close () { if (ReadFileDescriptor != -1) + { close (ReadFileDescriptor); + ReadFileDescriptor = -1; + } if (WriteFileDescriptor != -1) + { close (WriteFileDescriptor); + WriteFileDescriptor = -1; + } } int Pipe::GetReadFD ()