about summary refs log tree commit diff
path: root/iconv
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-12-17 11:18:37 +0000
committerUlrich Drepper <drepper@redhat.com>1998-12-17 11:18:37 +0000
commitc7ec9d75a79e1ed2d558447ba788318d3f1fb76c (patch)
treed7526c47b17dd00b5b3590802ad67bc1f43c4899 /iconv
parent4798763f3fb51d5d8e599fe7ecf359464b826c6c (diff)
downloadglibc-c7ec9d75a79e1ed2d558447ba788318d3f1fb76c.tar.gz
glibc-c7ec9d75a79e1ed2d558447ba788318d3f1fb76c.tar.xz
glibc-c7ec9d75a79e1ed2d558447ba788318d3f1fb76c.zip
Update.
	* iconv/gconv_db.c (gen_steps): Respect error return value from
	init functions and abort.
Diffstat (limited to 'iconv')
-rw-r--r--iconv/gconv_db.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/iconv/gconv_db.c b/iconv/gconv_db.c
index be2b7fa233..f5a67ffbab 100644
--- a/iconv/gconv_db.c
+++ b/iconv/gconv_db.c
@@ -181,6 +181,7 @@ gen_steps (struct derivation_step *best, const char *toset,
     {
       int failed = 0;
 
+      status = GCONV_OK;
       *nsteps = step_cnt;
       current = best;
       while (step_cnt-- > 0)
@@ -220,7 +221,18 @@ gen_steps (struct derivation_step *best, const char *toset,
 
 	  /* Call the init function.  */
 	  if (result[step_cnt].init_fct != NULL)
-	    _CALL_DL_FCT (result[step_cnt].init_fct, (&result[step_cnt]));
+	     {
+	       status = _CALL_DL_FCT (result[step_cnt].init_fct,
+				      (&result[step_cnt]));
+	       
+	       if (status != GCONV_OK)
+		 {
+		   failed = 1;
+		   /* Make sure we unload this modules.  */
+		   --step_cnt;
+		   break;
+		 }
+	     }
 
 	  current = current->last;
 	}
@@ -239,13 +251,11 @@ gen_steps (struct derivation_step *best, const char *toset,
 	  free (result);
 	  *nsteps = 0;
 	  *handle = NULL;
-	  status = GCONV_NOCONV;
+	  if (status == GCONV_OK)
+	    status = GCONV_NOCONV;
 	}
       else
-	{
-	  *handle = result;
-	  status = GCONV_OK;
-	}
+	*handle = result;
     }
   else
     {