|
@@ -26,6 +26,7 @@
|
|
|
#include "SpShellConsole.h"
|
|
|
#endif //_WIN32
|
|
|
#include <winpr/crt.h>
|
|
|
+#include <winpr/file.h>
|
|
|
|
|
|
struct app_t g_app;
|
|
|
|
|
@@ -376,23 +377,21 @@ int app_init(const sp_cfg_start_args_t* args)
|
|
|
}
|
|
|
sp_dbg_info("kickoff startlist thread proc ok!");
|
|
|
|
|
|
-#ifdef _DEBUG
|
|
|
+#if defined(RVC_OS_WIN) && defined(WITH_DEBUG)
|
|
|
+
|
|
|
// start console service
|
|
|
int nConsolePort = env->cfg->shell_ini->nConsolePort;
|
|
|
- if (nConsolePort >0)
|
|
|
- {
|
|
|
+ if (nConsolePort > 0) {
|
|
|
g_app.pConsole = new CSpShellConsole();
|
|
|
- if (!g_app.pConsole->StartListen(nConsolePort))
|
|
|
- {
|
|
|
+ if (!g_app.pConsole->StartListen(nConsolePort)) {
|
|
|
sp_dbg_error("start spshell console service at port %d fail, %s", nConsolePort, g_app.pConsole->GetLastErrorMsg());
|
|
|
return Error_Unexpect;
|
|
|
}
|
|
|
|
|
|
sp_dbg_info("start spshell console service at port %d ok!", nConsolePort);
|
|
|
}
|
|
|
-#endif
|
|
|
-
|
|
|
|
|
|
+#endif // RVC_OS_WIN && WITH_DEBUG
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
sp_runtask_startprocess();
|
|
@@ -407,13 +406,15 @@ int app_term()
|
|
|
{
|
|
|
int rc;
|
|
|
|
|
|
-#ifdef _DEBUG
|
|
|
+#if defined(RVC_OS_WIN) && defined(WITH_DEBUG)
|
|
|
+
|
|
|
if (g_app.pConsole != NULL) {
|
|
|
g_app.pConsole->StopListen();
|
|
|
//delete g_app.pConsole;
|
|
|
g_app.pConsole = NULL;
|
|
|
}
|
|
|
-#endif //_DEBUG
|
|
|
+
|
|
|
+#endif //defined(RVC_OS_WIN) && defined(WITH_DEBUG)
|
|
|
|
|
|
/*kill all children process ?*/
|
|
|
rc = sp_mod_mgr_terminate_all_entity(sp_get_env()->mod_mgr, 0/*SP_SHELL_SVC_ID*/);
|