libc/locale: Use O_CLOEXEC when opening locale tables
Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
2411ac0b89
commit
98bfb9dac2
@ -131,7 +131,7 @@ __collate_load_tables_l(const char *encoding, struct xlocale_collate *table)
|
||||
if (asprintf(&buf, "%s/%s/LC_COLLATE", _PathLocale, encoding) == -1)
|
||||
return (_LDP_ERROR);
|
||||
|
||||
if ((fd = _open(buf, O_RDONLY)) < 0) {
|
||||
if ((fd = _open(buf, O_RDONLY | O_CLOEXEC)) < 0) {
|
||||
free(buf);
|
||||
return (_LDP_ERROR);
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ _Read_RuneMagi(const char *fname)
|
||||
int runetype_ext_len = 0;
|
||||
int fd;
|
||||
|
||||
if ((fd = _open(fname, O_RDONLY)) < 0) {
|
||||
if ((fd = _open(fname, O_RDONLY | O_CLOEXEC)) < 0) {
|
||||
errno = EINVAL;
|
||||
return (NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user