X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=service.cpp;h=2d20ff30b5017fbbe1441c23d596af7572d64341;hb=800ca0c4f150de75c38c87a59d18878b0341f16b;hp=88c1820d670aca20be0a166f7ee4fd87217828a6;hpb=adda6b2aaf2a5631d0dfa0371f8f93855176a9c8;p=nssm.git diff --git a/service.cpp b/service.cpp index 88c1820..2d20ff3 100644 --- a/service.cpp +++ b/service.cpp @@ -2078,7 +2078,7 @@ void CALLBACK end_service(void *arg, unsigned char why) { stop_service(service, exitcode, false, default_action); wait_for_hooks(service, false); free_imports(); - exit(exitcode); + nssm_exit(exitcode); } } @@ -2212,7 +2212,9 @@ awaited: return ret; } -int list_nssm_services() { +int list_nssm_services(int argc, TCHAR **argv) { + bool including_native = (argc > 0 && str_equiv(argv[0], _T("all"))); + /* Open service manager. */ SC_HANDLE services = open_service_manager(SC_MANAGER_CONNECT | SC_MANAGER_ENUMERATE_SERVICE); if (! services) { @@ -2259,7 +2261,7 @@ int list_nssm_services() { get_parameters(service, 0); /* We manage the service if we have an Application. */ - if (service->exe[0]) _tprintf(_T("%s\n"), service->name); + if (including_native || service->exe[0]) _tprintf(_T("%s\n"), service->name); cleanup_nssm_service(service); }