Report errors when setlocale() fails
This commit is contained in:
parent
a3508ddbfe
commit
627949e27c
|
@ -52,6 +52,7 @@ static int _message(unsigned int timeout, GtkMessageType type,
|
||||||
/* callbacks */
|
/* callbacks */
|
||||||
static gboolean _message_on_timeout(gpointer data);
|
static gboolean _message_on_timeout(gpointer data);
|
||||||
|
|
||||||
|
static int _error(char const * message, int ret);
|
||||||
static int _usage(void);
|
static int _usage(void);
|
||||||
|
|
||||||
|
|
||||||
|
@ -149,6 +150,15 @@ static gboolean _message_on_timeout(gpointer data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* error */
|
||||||
|
static int _error(char const * message, int ret)
|
||||||
|
{
|
||||||
|
fputs(PROGNAME ": ", stderr);
|
||||||
|
perror(message);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* usage */
|
/* usage */
|
||||||
static int _usage(void)
|
static int _usage(void)
|
||||||
{
|
{
|
||||||
|
@ -169,7 +179,8 @@ int main(int argc, char * argv[])
|
||||||
int o;
|
int o;
|
||||||
char * p;
|
char * p;
|
||||||
|
|
||||||
setlocale(LC_ALL, "");
|
if(setlocale(LC_ALL, "") == NULL)
|
||||||
|
_error("setlocale", 1);
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
gtk_init(&argc, &argv);
|
gtk_init(&argc, &argv);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user