From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31648 invoked by alias); 4 Feb 2006 11:58:45 -0000 Received: (qmail 31638 invoked by uid 22791); 4 Feb 2006 11:58:44 -0000 X-Spam-Check-By: sourceware.org Received: from gandalf.inter.net.il (HELO gandalf.inter.net.il) (192.114.186.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 04 Feb 2006 11:58:43 +0000 Received: from nitzan.inter.net.il (nitzan.inter.net.il [192.114.186.20]) by gandalf.inter.net.il (MOS 3.7.1-GA) with ESMTP id HTS07898; Sat, 4 Feb 2006 13:58:39 +0200 (IST) Received: from HOME-C4E4A596F7 (IGLD-83-130-205-46.inter.net.il [83.130.205.46]) by nitzan.inter.net.il (MOS 3.7.3-GA) with ESMTP id CPY48370 (AUTH halo1); Sat, 4 Feb 2006 13:58:38 +0200 (IST) Date: Sat, 04 Feb 2006 11:58:00 -0000 Message-Id: From: Eli Zaretskii To: gdb-patches@sourceware.org In-reply-to: <20060203215455.GA3501@nevyn.them.org> (message from Daniel Jacobowitz on Fri, 3 Feb 2006 16:54:55 -0500) Subject: Re: RFA: Support Windows extended error numbers in safe_strerror Reply-to: Eli Zaretskii References: <20060203215455.GA3501@nevyn.them.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00066.txt.bz2 > Date: Fri, 3 Feb 2006 16:54:55 -0500 > From: Daniel Jacobowitz > > 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 > > * 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.