Print this page
Thread safety fixes.
*** 45,62 ****
numempty /* grouping */
};
struct locdata __posix_numeric_locdata = {
.l_lname = "C",
- .l_refcnt = (uint32_t)-1,
.l_data = { &lc_numeric_posix }
};
/*
! * Return the locale's numeric locdata structure, places a hold on it,
! * which the caller must release.
*/
struct locdata *
__lc_numeric_load(const char *name)
{
struct locdata *ldata;
--- 45,60 ----
numempty /* grouping */
};
struct locdata __posix_numeric_locdata = {
.l_lname = "C",
.l_data = { &lc_numeric_posix }
};
/*
! * Return the locale's numeric locdata structure.
*/
struct locdata *
__lc_numeric_load(const char *name)
{
struct locdata *ldata;
*** 71,81 ****
ret = __part_load_locale(name, (char **)&ldata->l_data[1],
"LC_NUMERIC", LCNUMERIC_SIZE, LCNUMERIC_SIZE, (const char **)lnum);
if (ret != _LDP_LOADED) {
! __locdata_release(ldata);
return (NULL);
}
/* Can't be empty according to C99 */
if (*lnum->decimal_point == '\0')
--- 69,79 ----
ret = __part_load_locale(name, (char **)&ldata->l_data[1],
"LC_NUMERIC", LCNUMERIC_SIZE, LCNUMERIC_SIZE, (const char **)lnum);
if (ret != _LDP_LOADED) {
! __locdata_free(ldata);
return (NULL);
}
/* Can't be empty according to C99 */
if (*lnum->decimal_point == '\0')