newlocale: set errno to ENOENT if __loadlocale fails
__loadlocale never sets errno, but newlocale is supposed to
return ENOENT if the locale isn't valid.
Fixes: aefd8b5b51
("Implement newlocale, freelocale, duplocale, uselocale")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
87ab6c7b26
commit
606373e7d2
|
@ -171,7 +171,10 @@ _newlocale_r (struct _reent *p, int category_mask, const char *locale,
|
|||
continue;
|
||||
/* Otherwise load locale data. */
|
||||
else if (!__loadlocale (&tmp_locale, i, new_categories[i]))
|
||||
goto error;
|
||||
{
|
||||
p->_errno = ENOENT;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Allocate new locale_t. */
|
||||
|
|
Loading…
Reference in New Issue