X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprocess.c;h=c2940bc52c3a545c1ecc003f929e68725f505819;hp=11e8b4fc7b98920fadb981e4fe1c7cc74eced74d;hb=e9576632dc4b780b867044269d06cc50f76d8c05;hpb=de78d79db84c486afcc353884ec1770866beb653 diff --git a/src/process.c b/src/process.c index 11e8b4fc..c2940bc5 100644 --- a/src/process.c +++ b/src/process.c @@ -1,7 +1,7 @@ /* process.c -- process management functions Copyright (C) 1999-2005 Ivo Timmermans, - 2000-2006 Guus Sliepen + 2000-2007 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -154,6 +154,9 @@ bool remove_service(void) { DWORD WINAPI controlhandler(DWORD request, DWORD type, LPVOID boe, LPVOID bah) { switch(request) { + case SERVICE_CONTROL_INTERROGATE: + SetServiceStatus(statushandle, &status); + return NO_ERROR; case SERVICE_CONTROL_STOP: logger(LOG_NOTICE, _("Got %s request"), "SERVICE_CONTROL_STOP"); break; @@ -379,8 +382,10 @@ bool execute_script(const char *name, char **envp) /* First check if there is a script */ - if(stat(scriptname + 1, &s)) + if(stat(scriptname + 1, &s)) { + free(scriptname); return true; + } ifdebug(STATUS) logger(LOG_INFO, _("Executing script %s"), name);