--------------------- PatchSet 3547 Date: 2002/01/06 15:17:38 Author: serassio Branch: cygwin-svc Tag: (none) Log: Added print of Service command line in cache.log at startup Members: src/globals.h:1.5.12.10.2.6->1.5.12.10.2.7 src/main.c:1.12.2.12.2.8->1.12.2.12.2.9 src/win32.c:1.1.50.6.2.20->1.1.50.6.2.21 Index: squid/src/globals.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/globals.h,v retrieving revision 1.5.12.10.2.6 retrieving revision 1.5.12.10.2.7 diff -u -r1.5.12.10.2.6 -r1.5.12.10.2.7 --- squid/src/globals.h 20 Oct 2001 12:30:52 -0000 1.5.12.10.2.6 +++ squid/src/globals.h 6 Jan 2002 15:17:38 -0000 1.5.12.10.2.7 @@ -1,6 +1,6 @@ /* - * $Id: globals.h,v 1.5.12.10.2.6 2001/10/20 12:30:52 serassio Exp $ + * $Id: globals.h,v 1.5.12.10.2.7 2002/01/06 15:17:38 serassio Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -163,6 +163,7 @@ extern char *WIN32_OS_string; /* NULL */ extern char *WIN32_Service_name; /* NULL */ extern char *WIN32_Command_Line; /* NULL */ +extern char *WIN32_Service_Command_Line; /* NULL */ extern unsigned int WIN32_run_mode; /* _WIN_SQUID_RUN_MODE_INTERACTIVE */ #endif Index: squid/src/main.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/main.c,v retrieving revision 1.12.2.12.2.8 retrieving revision 1.12.2.12.2.9 diff -u -r1.12.2.12.2.8 -r1.12.2.12.2.9 --- squid/src/main.c 28 Dec 2001 16:12:04 -0000 1.12.2.12.2.8 +++ squid/src/main.c 6 Jan 2002 15:17:38 -0000 1.12.2.12.2.9 @@ -1,6 +1,6 @@ /* - * $Id: main.c,v 1.12.2.12.2.8 2001/12/28 16:12:04 serassio Exp $ + * $Id: main.c,v 1.12.2.12.2.9 2002/01/06 15:17:38 serassio Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -531,8 +531,10 @@ version_string, CONFIG_HOST_TYPE); #if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) - if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) + if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) { debug(1, 0) ("Running as %s Windows System Service on %s\n", WIN32_Service_name, WIN32_OS_string); + debug(1, 0) ("Service command line is: %s\n", WIN32_Service_Command_Line); + } else debug(1, 0) ("Running on %s\n",WIN32_OS_string); #endif Index: squid/src/win32.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/win32.c,v retrieving revision 1.1.50.6.2.20 retrieving revision 1.1.50.6.2.21 diff -u -r1.1.50.6.2.20 -r1.1.50.6.2.21 --- squid/src/win32.c 28 Dec 2001 15:55:23 -0000 1.1.50.6.2.20 +++ squid/src/win32.c 6 Jan 2002 15:17:38 -0000 1.1.50.6.2.21 @@ -95,7 +95,7 @@ HKEY hKey; HKEY hKeyNext; int retval; - int rv; + long rv; hKey = HKEY_LOCAL_MACHINE; index = 0; @@ -109,13 +109,13 @@ NULL, /* class */ REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKeyNext, &result); if (rv != ERROR_SUCCESS) { - debug(1, 1) ("RegCreateKeyEx(%s),%d\n", keys[index], rv); + debug(1, 1) ("RegCreateKeyEx(%s),%d\n", keys[index], (int) rv); retval = -4; } /* Close the old key */ rv = RegCloseKey(hKey); if (rv != ERROR_SUCCESS) { - debug(1, 1) ("RegCloseKey %d\n", rv); + debug(1, 1) ("RegCloseKey %d\n", (int) rv); if (retval == 0) { /* Keep error status from RegCreateKeyEx, if any */ retval = -4; @@ -133,7 +133,7 @@ */ rv = RegCloseKey(hKey); if (rv != ERROR_SUCCESS) { - debug(1, 1) ("RegCloseKey %d\n", rv); + debug(1, 1) ("RegCloseKey %d\n", (int) rv); if (retval == 0) { /* Keep error status from RegCreateKeyEx, if any */ retval = -4; @@ -372,7 +372,6 @@ if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) { char path[512]; HKEY hndKey; - char * CommandLine = NULL; if (signal(SIGABRT, WIN32_Abort) == SIG_ERR) return 1; /* Register the service Handler function */ @@ -416,17 +415,17 @@ Result = RegQueryValueEx(hndKey, COMMANDLINE, NULL, &Type, NULL, &Size); if (Result == ERROR_SUCCESS && Size) { - CommandLine = xmalloc(Size); - RegQueryValueEx(hndKey, COMMANDLINE, NULL, &Type, CommandLine, + WIN32_Service_Command_Line = xmalloc(Size); + RegQueryValueEx(hndKey, COMMANDLINE, NULL, &Type, WIN32_Service_Command_Line, &Size); } else - CommandLine = xstrdup(""); + WIN32_Service_Command_Line = xstrdup(""); RegCloseKey(hndKey); } else { ConfigFile = xstrdup(DefaultConfigFile); - CommandLine = xstrdup(""); + WIN32_Service_Command_Line = xstrdup(""); } - WIN32_build_argv(CommandLine); + WIN32_build_argv(WIN32_Service_Command_Line); *argc = WIN32_argc; *argv = WIN32_argv; }