Browse code

core: test if shm is initialized on early shutdown

Daniel-Constantin Mierla authored on 27/11/2020 06:49:27
Showing 1 changed files
... ...
@@ -43,6 +43,7 @@
43 43
 #include "sr_compat.h"
44 44
 #include "ppcfg.h"
45 45
 #include "async_task.h"
46
+#include "shm_init.h"
46 47
 
47 48
 #include <sys/stat.h>
48 49
 #include <regex.h>
... ...
@@ -114,7 +115,7 @@ static int *_ksr_shutdown_phase = NULL;
114 115
 
115 116
 int ksr_shutdown_phase_init(void)
116 117
 {
117
-	if(_ksr_shutdown_phase == NULL) {
118
+	if((_ksr_shutdown_phase == NULL) && (shm_initialized())) {
118 119
 		_ksr_shutdown_phase = (int*)shm_malloc(sizeof(int));
119 120
 	}
120 121
 	return 0;