--------------------- PatchSet 6315 Date: 2004/10/03 15:02:59 Author: serassio Branch: nt-2_5 Tag: (none) Log: Added redirection of stderr when running as a Windows Service Members: src/win32.c:1.5.14.21->1.5.14.22 Index: squid/src/win32.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/win32.c,v retrieving revision 1.5.14.21 retrieving revision 1.5.14.22 diff -u -r1.5.14.21 -r1.5.14.22 --- squid/src/win32.c 29 Aug 2004 08:27:08 -0000 1.5.14.21 +++ squid/src/win32.c 3 Oct 2004 15:02:59 -0000 1.5.14.22 @@ -716,8 +716,13 @@ {NULL, NULL} }; char *c; - + char stderr_path[256]; + if ((argc == 2) && strstr(argv[1], _WIN_SQUID_SERVICE_OPTION)){ + strcpy(stderr_path, argv[0]); + strcat(stderr_path,".log"); + freopen(stderr_path, "w", stderr); + setmode(fileno(stderr), O_TEXT); WIN32_run_mode = _WIN_SQUID_RUN_MODE_SERVICE; if (!(c=strchr(argv[1],':'))){ fprintf(stderr, "Bad Service Parameter: %s\n", argv[1]);