Update from 0.9.8 stable. Eliminate duplicate error codes.
[openssl.git] / crypto / engine / eng_err.c
index 70fbc4de1e0eefaac64ff3a74cec0e069d82a3f0..bc755ff05035796a93851669954636efa1f3d5a5 100644 (file)
@@ -1,6 +1,6 @@
 /* crypto/engine/eng_err.c */
 /* ====================================================================
- * Copyright (c) 1999-2005 The OpenSSL Project.  All rights reserved.
+ * Copyright (c) 1999-2006 The OpenSSL Project.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -160,15 +160,12 @@ static ERR_STRING_DATA ENGINE_str_reasons[]=
 
 void ERR_load_ENGINE_strings(void)
        {
-       static int init=1;
+#ifndef OPENSSL_NO_ERR
 
-       if (init)
+       if (ERR_func_error_string(ENGINE_str_functs[0].error) == NULL)
                {
-               init=0;
-#ifndef OPENSSL_NO_ERR
                ERR_load_strings(0,ENGINE_str_functs);
                ERR_load_strings(0,ENGINE_str_reasons);
-#endif
-
                }
+#endif
        }