aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-07-11 09:19:25 +0000
committerUlrich Drepper <drepper@redhat.com>2002-07-11 09:19:25 +0000
commit9d957ce2a2cfefb4580e37b744b581381604106f (patch)
tree98eb1e29cdeb706c016dc0b320d82f04ec789c71
parentcb2a71bbe44c4d274a7520c3e9c9e885dce1d426 (diff)
downloadglibc-9d957ce2a2cfefb4580e37b744b581381604106f.zip
glibc-9d957ce2a2cfefb4580e37b744b581381604106f.tar.gz
glibc-9d957ce2a2cfefb4580e37b744b581381604106f.tar.bz2
Update.
* resolv/res_hconf.c (_res_hconf_init): Move code into new function do_init. Use __libc_once. (do_init): New function.
-rw-r--r--ChangeLog4
-rw-r--r--localedata/ChangeLog4
-rw-r--r--resolv/res_hconf.c22
3 files changed, 22 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index fca5e01..263f1dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2002-07-11 Ulrich Drepper <drepper@redhat.com>
+ * resolv/res_hconf.c (_res_hconf_init): Move code into new
+ function do_init. Use __libc_once.
+ (do_init): New function.
+
* iconvdata/iso8859-11.h: Removed.
* iconvdata/Makefile (gen-8bit-gap-modules): Add iso8859-11.
(distribute): Remove iso8859-11.h.
diff --git a/localedata/ChangeLog b/localedata/ChangeLog
index a9f6a09..4f3c54c 100644
--- a/localedata/ChangeLog
+++ b/localedata/ChangeLog
@@ -1,3 +1,7 @@
+2002-07-11 Ulrich Drepper <drepper@redhat.com>
+
+ * charmaps/ISO-8859-11: New file.
+
2002-06-30 Ulrich Drepper <drepper@redhat.com>
* locales/lug_UG: New file.
diff --git a/resolv/res_hconf.c b/resolv/res_hconf.c
index b813799..e6faa68 100644
--- a/resolv/res_hconf.c
+++ b/resolv/res_hconf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995-2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger (davidm@azstarnet.com).
@@ -411,19 +411,14 @@ parse_line (const char *fname, int line_num, const char *str)
}
-/* Initialize hconf datastructure by reading host.conf file and
- environment variables. */
-void
-_res_hconf_init (void)
+static void
+do_init (void)
{
const char *hconf_name;
int line_num = 0;
char buf[256], *envval;
FILE *fp;
- if (_res_hconf.initialized)
- return;
-
memset (&_res_hconf, '\0', sizeof (_res_hconf));
hconf_name = getenv (ENV_HOSTCONF);
@@ -482,6 +477,17 @@ _res_hconf_init (void)
}
+/* Initialize hconf datastructure by reading host.conf file and
+ environment variables. */
+void
+_res_hconf_init (void)
+{
+ __libc_once_define (static, once);
+
+ __libc_once (once, do_init);
+}
+
+
/* List of known interfaces. */
static struct netaddr
{