make multiple config instead of one implicit global
This commit is contained in:
@@ -844,7 +844,7 @@ static bool exec_moduleinit(char *modname) {
|
||||
|
||||
int add_embeddedmodules(void) {
|
||||
int ret=0;
|
||||
int pindex = config_paramidx_fromname(telnetoptions,sizeof(telnetoptions)/sizeof(paramdef_t), TELNETSRV_OPTNAME_STATICMOD);
|
||||
int pindex = config_paramidx_fromname(telnetoptions, sizeofArray(telnetoptions), TELNETSRV_OPTNAME_STATICMOD);
|
||||
for(int i=0; i<telnetoptions[pindex].numelt; i++) {
|
||||
bool success = exec_moduleinit(telnetoptions[pindex].strlistptr[i]);
|
||||
if (success)
|
||||
@@ -856,7 +856,7 @@ int add_embeddedmodules(void) {
|
||||
|
||||
int add_sharedmodules(void) {
|
||||
int ret=0;
|
||||
int pindex = config_paramidx_fromname(telnetoptions,sizeof(telnetoptions)/sizeof(paramdef_t), TELNETSRV_OPTNAME_SHRMOD);
|
||||
int pindex = config_paramidx_fromname(telnetoptions, sizeofArray(telnetoptions), TELNETSRV_OPTNAME_SHRMOD);
|
||||
for(int i=0; i<telnetoptions[pindex].numelt; i++) {
|
||||
char *name = telnetoptions[pindex].strlistptr[i];
|
||||
char libname[256];
|
||||
@@ -875,7 +875,7 @@ int add_sharedmodules(void) {
|
||||
*/
|
||||
int telnetsrv_autoinit(void) {
|
||||
memset(&telnetparams,0,sizeof(telnetparams));
|
||||
config_get( telnetoptions,sizeof(telnetoptions)/sizeof(paramdef_t),"telnetsrv");
|
||||
config_get(config_get_if(), telnetoptions, sizeofArray(telnetoptions), "telnetsrv");
|
||||
/* possibly load a exec specific shared lib */
|
||||
char *execfunc=get_softmodem_function(NULL);
|
||||
char libname[64];
|
||||
|
||||
@@ -511,9 +511,9 @@ int proccmd_exit(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
int proccmd_restart(char *buf, int debug, telnet_printfunc_t prnt)
|
||||
{
|
||||
if (debug > 0)
|
||||
prnt("process module received %s\n", buf);
|
||||
end_configmodule();
|
||||
prnt("process module received %s\n", buf);
|
||||
configmodule_interface_t *cfg = config_get_if();
|
||||
end_configmodule(cfg);
|
||||
execvpe(cfg->argv[0], cfg->argv, environ);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user