From ca130fe4651a2ca547b05187bdc2804defc8a66b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 8 Aug 2001 21:25:01 +0000 Subject: Update. * catgets/open_catalog.c: Rewrite code to assume that the function is called at catopen time and not delayed in catgets. * catgets/catgets.c (catopen): Call __open_catalog and fail if that function failed. (catgets): Remove code for delayed opening of catalog. * catgets/catgetsinfo.h: Remove now unnecessary information from struct catalog_info. Change __open_catalog prototype. * catgets/gencat.c: Adjust __open_catalog call. * catgets/test-gencat.c: Stop program if catopen failed. --- catgets/gencat.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'catgets/gencat.c') diff --git a/catgets/gencat.c b/catgets/gencat.c index 103e8324bb..ce5c4dc50e 100644 --- a/catgets/gencat.c +++ b/catgets/gencat.c @@ -1187,21 +1187,15 @@ read_old (struct catalog *catalog, const char *file_name) int last_set = -1; size_t cnt; - old_cat_obj.status = closed; - old_cat_obj.cat_name = file_name; - old_cat_obj.nlspath = NULL; - __libc_lock_init (old_cat_obj.lock); - /* Try to open catalog, but don't look through the NLSPATH. */ - __open_catalog (&old_cat_obj); - - if (old_cat_obj.status != mmapped && old_cat_obj.status != malloced) + if (__open_catalog (file_name, NULL, NULL, &old_cat_obj) != 0) { if (errno == ENOENT) /* No problem, the catalog simply does not exist. */ return; else - error (EXIT_FAILURE, errno, gettext ("while opening old catalog file")); + error (EXIT_FAILURE, errno, + gettext ("while opening old catalog file")); } /* OK, we have the catalog loaded. Now read all messages and merge -- cgit 1.4.1