about summary refs log tree commit diff
path: root/catgets/test-gencat.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-08-08 21:25:01 +0000
committerUlrich Drepper <drepper@redhat.com>2001-08-08 21:25:01 +0000
commitca130fe4651a2ca547b05187bdc2804defc8a66b (patch)
tree9e743e6df3161a03fda43de4ff71f3b52f21c4fa /catgets/test-gencat.c
parent443470c3360d5d4ffb8f3078f47cda55fd5cffbd (diff)
downloadglibc-ca130fe4651a2ca547b05187bdc2804defc8a66b.tar.gz
glibc-ca130fe4651a2ca547b05187bdc2804defc8a66b.tar.xz
glibc-ca130fe4651a2ca547b05187bdc2804defc8a66b.zip
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.
Diffstat (limited to 'catgets/test-gencat.c')
-rw-r--r--catgets/test-gencat.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/catgets/test-gencat.c b/catgets/test-gencat.c
index fe5d0916b7..cb026fdc60 100644
--- a/catgets/test-gencat.c
+++ b/catgets/test-gencat.c
@@ -12,6 +12,12 @@ main (void)
   printf ("LC_MESSAGES = %s\n", setlocale (LC_MESSAGES, NULL));
 
   catalog = catopen ("sample", NL_CAT_LOCALE);
+  if (catalog == (nl_catd) -1)
+    {
+      printf ("no catalog: %m\n");
+      exit (1);
+    }
+
   printf ("%s\n", catgets(catalog, 1, 1, "sample 1"));
   printf ("%s\n", catgets(catalog, 1, 2, "sample 2"));
   printf ("%s\n", catgets(catalog, 1, 3, "sample 3"));