src/server/safs/init.c

changeset 90
279f343bbf6c
parent 84
afd57ce39ec9
child 92
382bff43c6eb
equal deleted inserted replaced
89:5eecce5314d6 90:279f343bbf6c
102 funcs += i + 1; 102 funcs += i + 1;
103 i = 0; 103 i = 0;
104 } 104 }
105 } 105 }
106 106
107 // if exists, execute nsapi_module_init
108 void *sym = dlsym(lib, "nsapi_module_init");
109 if(sym) {
110 /*
111 * We remove shlib and funcs from the pblock. The module init function
112 * gets all remaining parameters.
113 */
114 pblock_remove("shlib", pb);
115 pblock_remove("funcs", pb);
116
117 FuncPtr init_func = (FuncPtr)sym;
118 int ret = init_func(pb, NULL, NULL);
119 if(ret != REQ_PROCEED && ret != REQ_NOACTION) {
120 log_ereport(
121 LOG_FAILURE,
122 "nsapi_module_init for module %s failed",
123 shlib);
124 return REQ_ABORTED;
125 }
126 }
127
107 return REQ_PROCEED; 128 return REQ_PROCEED;
108 } 129 }

mercurial