Hi,

 

I believe M_ERRNO should handle this…

 

After the register_ring_buffers() exits, the Win32 error code is left in 
GetLastError().

msg(M_ERRNO) picks it from there and formats a human-readable message.

 

Regards, Simon

 

From: Lev Stipakov <lstipa...@gmail.com> 
Sent: Wednesday, February 5, 2020 8:38 PM
To: Simon Rozman <si...@rozman.si>
Cc: openvpn-devel <openvpn-devel@lists.sourceforge.net>
Subject: Re: [Openvpn-devel] [PATCH] wintun: upgrade error message in case of 
ring registration failure

 

Hi,

 

-            msg(M_NONFATAL, "Failed to register ring buffers: %lu", 
GetLastError());

<skip> 

+            switch (GetLastError())

<skip> 

+                default:
+                    msg(M_NONFATAL | M_ERRNO, "Failed to register ring 
buffers");

 

I think it would make sense to print the error code / error message (with 
strerror_win32) in the "default" case.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to