summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-02-01 18:19:27 +0100
committerLudovic Courtès <ludo@gnu.org>2013-02-01 18:19:34 +0100
commite2c6bf3866d1186c60bacfbd4fe5037087ee5e3f (patch)
treed2ad001847a3f7e00f455405ae7fe3e8a1ffbd1a /meta
parent8364ae3fac3645ad3e8b53a2c4faeeed162ea0ea (diff)
downloadguile-e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f.tar.gz
guild: Gracefully handle failures to install the locale.
* meta/guild.in (main): Catch `system-error' when calling `setlocale', and gracefully handle any error.
Diffstat (limited to 'meta')
-rwxr-xr-xmeta/guild.in10
1 files changed, 8 insertions, 2 deletions
diff --git a/meta/guild.in b/meta/guild.in
index 183323f75..d501a0daf 100755
--- a/meta/guild.in
+++ b/meta/guild.in
@@ -8,7 +8,7 @@ exec ${GUILE:-@bindir@/@guile_program_name@} $GUILE_FLAGS -e '(@@ (guild) main)'
;;;; guild --- running scripts bundled with Guile
;;;; Andy Wingo <wingo@pobox.com> --- April 2009
;;;;
-;;;; Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+;;;; Copyright (C) 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@@ -51,7 +51,13 @@ exec ${GUILE:-@bindir@/@guile_program_name@} $GUILE_FLAGS -e '(@@ (guild) main)'
(define (main args)
(if (defined? 'setlocale)
- (setlocale LC_ALL ""))
+ (catch 'system-error
+ (lambda ()
+ (setlocale LC_ALL ""))
+ (lambda args
+ (format (current-error-port)
+ "warning: failed to install locale: ~a~%"
+ (strerror (system-error-errno args))))))
(let* ((options (getopt-long args *option-grammar*
#:stop-at-first-non-option #t))