[Groonga-commit] pgroonga/pgroonga at dba9cd4 [master] Propagate double initialization

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Oct 3 21:57:12 JST 2015


Kouhei Sutou	2015-10-03 21:57:12 +0900 (Sat, 03 Oct 2015)

  New Revision: dba9cd45b1760efa3f3c51367c0b5f5481d5c335
  https://github.com/pgroonga/pgroonga/commit/dba9cd45b1760efa3f3c51367c0b5f5481d5c335

  Message:
    Propagate double initialization

  Modified files:
    pgroonga.c

  Modified: pgroonga.c (+9 -0)
===================================================================
--- pgroonga.c    2015-10-03 20:32:02 +0900 (25e7e7a)
+++ pgroonga.c    2015-10-03 21:57:12 +0900 (e3d692e)
@@ -52,6 +52,8 @@ typedef struct stat pgrn_stat_buffer;
 
 PG_MODULE_MAGIC;
 
+static bool PGrnInitialized = false;
+
 static bool PGrnIsLZ4Available;
 static relopt_kind PGrnReloptionKind;
 
@@ -540,6 +542,13 @@ PGrnInitializeOptions(void)
 void
 _PG_init(void)
 {
+	if (PGrnInitialized)
+		ereport(ERROR,
+				(errcode(ERRCODE_SYSTEM_ERROR),
+				 errmsg("pgroonga: already tried to initialize and failed")));
+
+	PGrnInitialized = true;
+
 	PGrnInitializeVariables();
 
 	if (grn_init() != GRN_SUCCESS)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index