From edwin@mavetju.org  Thu Nov 12 06:50:23 2009
Return-Path: <edwin@mavetju.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DB5D61065672
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 12 Nov 2009 06:50:23 +0000 (UTC)
	(envelope-from edwin@mavetju.org)
Received: from k7.mavetju.org (unknown [IPv6:2001:44b8:7bf1:a51:20f:eaff:fe2c:d518])
	by mx1.freebsd.org (Postfix) with ESMTP id 4EFCC8FC0C
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 12 Nov 2009 06:50:23 +0000 (UTC)
Received: by k7.mavetju.org (Postfix, from userid 1001)
	id ABB674513C; Thu, 12 Nov 2009 17:48:56 +1100 (EST)
Message-Id: <20091112064856.ABB674513C@k7.mavetju.org>
Date: Thu, 12 Nov 2009 17:48:56 +1100 (EST)
From: Edwin Groothuis <edwin@mavetju.org>
Reply-To: Edwin Groothuis <edwin@mavetju.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: teach perror(1) about localization
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         140499
>Category:       bin
>Synopsis:       [patch] teach perror(1) about localization
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    edwin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 12 07:00:09 UTC 2009
>Closed-Date:    Sun Dec 06 21:08:31 UTC 2009
>Last-Modified:  Sun Dec  6 21:10:02 UTC 2009
>Originator:     Edwin Groothuis
>Release:        FreeBSD 8.0-RC1 i386
>Organization:
-
>Environment:
System: FreeBSD k7.mavetju.org 8.0-RC1 FreeBSD 8.0-RC1 #1 r197608: Tue Sep 29 12:34:13 EST 2009 edwin@k7.mavetju.org:/usr/obj/usr/home/edwin/svn/build-8/sys/GENERIC i386


>Description:

Seen:
[~/svn/svn-head/usr.bin/perror] edwin@vaio>LANG=nl_NL.ISO8859-1 perror 2
No such file or directory

Expected:
[~/svn/svn-head/usr.bin/perror] edwin@vaio>LANG=nl_NL.ISO8859-1 ./perror 2
Bestand of map niet gevonden

>How-To-Repeat:
>Fix:

gnn@: feel free to reassign to edwin@ if approved.

Index: perror.c
===================================================================
--- perror.c    (revision 199198)
+++ perror.c    (working copy)
@@ -32,6 +32,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <err.h>
+#include <locale.h>
 #include <sys/errno.h>

 static void usage(void);
@@ -43,6 +44,7 @@
        char *errstr;
        long errnum;

+       (void) setlocale(LC_MESSAGES, "");
        if (argc != 2)
                usage();


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->gnn 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Nov 12 07:00:33 UTC 2009 
Responsible-Changed-Why:  
Over to author of perror(1). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=140499 
Responsible-Changed-From-To: gnn->edwin 
Responsible-Changed-By: gnn 
Responsible-Changed-When: Sun Nov 22 03:21:00 UTC 2009 
Responsible-Changed-Why:  
Patch looks fine to me.  Thanks for the fix. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=140499 
State-Changed-From-To: open->patched 
State-Changed-By: edwin 
State-Changed-When: Sun Nov 22 05:03:50 UTC 2009 
State-Changed-Why:  
Will MFC in a week. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=140499 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/140499: commit references a PR
Date: Sun, 22 Nov 2009 05:17:32 +0000 (UTC)

 Author: edwin
 Date: Sun Nov 22 05:17:22 2009
 New Revision: 199642
 URL: http://svn.freebsd.org/changeset/base/199642
 
 Log:
   The output of perror(1) is now showing local messages for locales
   supported by libc/nls
   
   PR:		bin/140499
   Approved by:	gnn@
 
 Modified:
   head/usr.bin/perror/perror.c
 
 Modified: head/usr.bin/perror/perror.c
 ==============================================================================
 --- head/usr.bin/perror/perror.c	Sat Nov 21 20:44:34 2009	(r199641)
 +++ head/usr.bin/perror/perror.c	Sun Nov 22 05:17:22 2009	(r199642)
 @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
  #include <stdlib.h>
  #include <string.h>
  #include <err.h>
 +#include <locale.h>
  #include <sys/errno.h>
  
  static void usage(void);
 @@ -43,6 +44,7 @@ main(int argc, char **argv)
  	char *errstr;
  	long errnum;
  
 +	(void) setlocale(LC_MESSAGES, "");
  	if (argc != 2)
  		usage();
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: edwin 
State-Changed-When: Sun Dec 6 21:08:19 UTC 2009 
State-Changed-Why:  
MFC done. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=140499 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/140499: commit references a PR
Date: Sun,  6 Dec 2009 21:08:01 +0000 (UTC)

 Author: edwin
 Date: Sun Dec  6 21:07:47 2009
 New Revision: 200186
 URL: http://svn.freebsd.org/changeset/base/200186
 
 Log:
   MFC of r199642
   
   The output of perror(1) is now showing local messages for locales
   supported by libc/nls
   
   PR:             bin/140499
   Approved by:    gnn@
 
 Modified:
   stable/8/usr.bin/perror/perror.c
 Directory Properties:
   stable/8/usr.bin/perror/   (props changed)
 
 Modified: stable/8/usr.bin/perror/perror.c
 ==============================================================================
 --- stable/8/usr.bin/perror/perror.c	Sun Dec  6 20:30:21 2009	(r200185)
 +++ stable/8/usr.bin/perror/perror.c	Sun Dec  6 21:07:47 2009	(r200186)
 @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
  #include <stdlib.h>
  #include <string.h>
  #include <err.h>
 +#include <locale.h>
  #include <sys/errno.h>
  
  static void usage(void);
 @@ -43,6 +44,7 @@ main(int argc, char **argv)
  	char *errstr;
  	long errnum;
  
 +	(void) setlocale(LC_MESSAGES, "");
  	if (argc != 2)
  		usage();
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
