From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Bruno Haible Newsgroups: gmane.lisp.guile.devel Subject: setlocale - incorrect error signalled Date: Fri, 21 Jan 2005 13:15:01 +0100 Message-ID: <200501211315.01753.bruno@clisp.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1106310243 20506 80.91.229.6 (21 Jan 2005 12:24:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Jan 2005 12:24:03 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jan 21 13:23:57 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CrxpU-0001Y6-00 for ; Fri, 21 Jan 2005 13:23:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cry1W-0007iX-8D for guile-devel@m.gmane.org; Fri, 21 Jan 2005 07:36:22 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Cry1K-0007ec-6W for guile-devel@gnu.org; Fri, 21 Jan 2005 07:36:10 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Cry1I-0007dY-D3 for guile-devel@gnu.org; Fri, 21 Jan 2005 07:36:08 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cry1H-0007ca-Ke for guile-devel@gnu.org; Fri, 21 Jan 2005 07:36:07 -0500 Original-Received: from [81.80.162.195] (helo=ftp.ilog.fr) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CrxmQ-0002BR-LU for guile-devel@gnu.org; Fri, 21 Jan 2005 07:20:47 -0500 Original-Received: from laposte.ilog.fr (cerbere-qfe0 [81.80.162.193]) by ftp.ilog.fr (8.13.1/8.13.1) with ESMTP id j0LCKj0t014904 for ; Fri, 21 Jan 2005 13:20:45 +0100 (MET) Original-Received: from honolulu.ilog.fr ([172.16.15.122]) by laposte.ilog.fr (8.13.1/8.13.1) with ESMTP id j0LCKd3F016678; Fri, 21 Jan 2005 13:20:40 +0100 (MET) Original-Received: from localhost (localhost [127.0.0.1]) by honolulu.ilog.fr (Postfix) with ESMTP id C02B13BD69; Fri, 21 Jan 2005 12:15:02 +0000 (UTC) Original-To: guile-devel@gnu.org User-Agent: KMail/1.5 Content-Disposition: inline X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:4710 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:4710 When setlocale is called with a locale name that doesn't exist, the C function setlocale() returns NULL, and guile signals an error. This is OK. But guile presents incorrect error details: $ guile guile> (setlocale LC_ALL "uk_UK.UTF-8") Backtrace: In standard input: 1: 0* [setlocale 6 "uk_UK.UTF-8"] standard input:1:1: In procedure setlocale in expression (setlocale LC_ALL "uk_UK.UTF-8"): standard input:1:1: No such file or directory "No such file or directory" is incorrect. setlocale() is not required to set errno when it fails, see http://www.opengroup.org/onlinepubs/009695399/functions/setlocale.html Therefore guile should not look at errno when it signals an error. libguile/posix.c: rv = setlocale (scm_i_to_lc_category (category, 1), clocale); if (rv == NULL) SCM_SYSERROR; <=== This is the problem. Bruno _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel