This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Support Windows extended error numbers in safe_strerror


> Date: Fri, 3 Feb 2006 16:54:55 -0500
> From: Daniel Jacobowitz <drow@false.org>
> 
> This is an improved version of a patch Mark Mitchell submitted last
> year.  If you give strerror() anything above 42 (sys_nerr) on Windows,
> it gives you back "Unknown error" - particularly unfortunate since
> WSAECONNREFUSED is way above there, so connecting to a closed socket
> will give you a generic error message.  This patch lets us try an
> OS-specific interface to fetch an error string.
> 
> [Actually you need my next patch too to get the connection refused message;
> right now you'll get a timeout.]
> 
> Any comments on this patch?
> 
> -- 
> Daniel Jacobowitz
> CodeSourcery
> 
> 2006-02-03  Daniel Jacobowitz  <dan@codesourcery.com>
> 
> 	* utils.c (safe_strerror): Try to use FormatMessage for otherwise
> 	unknown messages on Windows.

How about if you put this in some function on win32-nat.c, and then
leave only the conditional call to that function in utils.c?  Actualy,
perhaps we don't need any ifdef at all, since I think there's no way
the argument can be greater than sys_nerr on other platforms, right?

Otherwise, I'm okay with this patch.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]