浏览代码

- base64 init and endianness checks on startup

Andrei Pelinescu-Onciul 17 年之前
父节点
当前提交
f769a6204c
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      main.c

+ 11 - 0
main.c

@@ -162,6 +162,8 @@
 #include "cfg/cfg.h"
 #include "cfg/cfg_struct.h"
 #include "cfg_core.h"
+#include "endianness.h" /* init */
+#include "basex.h" /* init */
 
 #ifdef DEBUG_DMALLOC
 #include <dmalloc.h>
@@ -1723,6 +1725,15 @@ try_again:
 		LOG(L_CRIT, "could not declare the core configuration\n");
 		goto error;
 	}
+
+	if (endianness_sanity_check() != 0){
+		LOG(L_CRIT, "BUG: endianness sanity tests failed\n");
+		goto error;
+	}
+	if (init_basex() != 0){
+		LOG(L_CRIT, "could not initialize base* framework\n");
+		goto error;
+	}
 	
 	if (init_modules() != 0) {
 		fprintf(stderr, "ERROR: error while initializing modules\n");