From d62a8200e1523a19c722eab97f54e34079fc3d0e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 15 Nov 2011 14:00:58 -0500 Subject: Use O_CLOEXEC in a few more places --- locale/loadarchive.c | 7 ++++--- locale/loadlocale.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'locale') diff --git a/locale/loadarchive.c b/locale/loadarchive.c index 663202e54e..47a6127a52 100644 --- a/locale/loadarchive.c +++ b/locale/loadarchive.c @@ -1,5 +1,5 @@ /* Code to load locale data from the locale archive file. - Copyright (C) 2002, 2003, 2005, 2010 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2005, 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -203,7 +203,7 @@ _nl_load_locale_from_archive (int category, const char **namep) archmapped = &headmap; /* The archive has never been opened. */ - fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE); + fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC); if (fd < 0) /* Cannot open the archive, for whatever reason. */ return NULL; @@ -394,7 +394,8 @@ _nl_load_locale_from_archive (int category, const char **namep) if (fd == -1) { struct stat64 st; - fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE); + fd = open_not_cancel_2 (archfname, + O_RDONLY|O_LARGEFILE|O_CLOEXEC); if (fd == -1) /* Cannot open the archive, for whatever reason. */ return NULL; diff --git a/locale/loadlocale.c b/locale/loadlocale.c index 61e6f7f0a6..d33a494134 100644 --- a/locale/loadlocale.c +++ b/locale/loadlocale.c @@ -1,5 +1,5 @@ /* Functions to read locale data files. - Copyright (C) 1996-2004, 2005, 2006, 2010 Free Software Foundation, Inc. + Copyright (C) 1996-2004, 2005, 2006, 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -173,7 +173,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) file->decided = 1; file->data = NULL; - fd = open_not_cancel_2 (file->filename, O_RDONLY); + fd = open_not_cancel_2 (file->filename, O_RDONLY | O_CLOEXEC); if (__builtin_expect (fd, 0) < 0) /* Cannot open the file. */ return; @@ -201,7 +201,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) _nl_category_names.str + _nl_category_name_idxs[category], _nl_category_name_sizes[category] + 1); - fd = open_not_cancel_2 (newp, O_RDONLY); + fd = open_not_cancel_2 (newp, O_RDONLY | O_CLOEXEC); if (__builtin_expect (fd, 0) < 0) return; -- cgit 1.4.1