Message-ID: Date: Tue, 5 Apr 2022 13:21:35 +0200 MIME-Version: 1.0 Content-Language: en-US References: <20220402070902.30282-1-a@...2181...> <20220402070902.30282-6-a@...2181...> <922985778.595013.1649152849318@...2642...> From: Antonio Quartulli In-Reply-To: <922985778.595013.1649152849318@...2642...> Subject: Re: [Openvpn-devel] [PATCH 5/7] tun: extract close_tun_handle into its own fucntion and print correct type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit To: Frank Lichtenheld , openvpn-devel@lists.sourceforge.net Hi, On 05/04/2022 12:00, Frank Lichtenheld wrote: > Acked-by: Frank Lichtenheld > > Seems trivial. > >> Antonio Quartulli hat am 02.04.2022 09:09 geschrieben: > [...] >> + if (tt->hand != NULL) >> + { >> + dmsg(D_WIN32_IO_LOW, "Attempting CloseHandle on %s adapter", adaptertype); >> + if (!CloseHandle(tt->hand)) >> + { >> + msg(M_WARN | M_ERRNO, "Warning: CloseHandle failed on %s adapter", adaptertype); >> + } >> + tt->hand = NULL; > > Setting hand to NULL is a slight behavior change, it wasn't there before. > It might be nice to acknowledge it in the commit message just to confirm that > it was a deliberate change. Yes, it was a deliberate change. This helper function will be invoked by (possibly) multiple places, so it's better to set a precondition and prevent a double close. I agree we should add a sentence to the commit message about this. Regards, -- Antonio Quartulli