Message-ID: Date: Fri, 10 Feb 2023 20:19:47 +0100 MIME-Version: 1.0 Content-Language: en-US References: <20230210133159.1336-1-lstipakov@...277...> From: Antonio Quartulli In-Reply-To: <20230210133159.1336-1-lstipakov@...277...> Subject: Re: [Openvpn-devel] [PATCH] Improve format specifier for socket handle in Windows 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: Lev Stipakov , openvpn-devel@lists.sourceforge.net Cc: Lev Stipakov Hi, On 10/02/2023 14:31, Lev Stipakov wrote: > From: Lev Stipakov > > Socket is a handle on Windows, which is usually logged in hex. > Also an interesting value is INVALID_SOCKET, which is ~0. > > PRIuPTR prints decimals, and for INVALID_SOCKET it prints something like > > 2023-02-10 14:45:21 us=906000 write to TUN/TAP : Jrjestelmkutsulle > annettu data-alue on liian pieni. (fd=18446744073709551615,code=122) > > PRIxPTR prints hex, and INVALID_SOCKET looks a bit nicer: > > 2023-02-10 15:17:11 us=828000 write to TUN/TAP : Jrjestelmkutsulle > annettu data-alue on liian pieni. (fd=ffffffffffffffff,code=122) > > Reported-by: Selva Nair > Signed-off-by: Lev Stipakov I also discussed this with Lev and, despite this being different from what we do in the *nix world (where decimal representations make sense for file descriptors), it seems to be the right hting to do on Windows when using HANDLEs (shrug). Acked-by: Antonio Quartulli -- Antonio Quartulli