]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Improve format specifier for socket handle in Windows
authorLev Stipakov <lev@openvpn.net>
Fri, 10 Feb 2023 13:31:59 +0000 (15:31 +0200)
committerGert Doering <gert@greenie.muc.de>
Tue, 14 Feb 2023 13:07:02 +0000 (14:07 +0100)
commit6731314a82d1a3c76b5497749985ee20c0c7d8eb
tree23f73c281245c8823d6f9f6981814454585dccf3
parent48d27e29e68c6049872abbee38b1375522de249f
Improve format specifier for socket handle in Windows

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 <selva.nair@gmail.com>
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20230210133159.1336-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26220.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/syshead.h