Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 24523 invoked by uid 6000); 3 Feb 2000 05:10:47 -0000 Received: (qmail 24406 invoked from network); 3 Feb 2000 05:10:41 -0000 Received: from igs1.lnd.com (root@156.46.97.3) by taz.hyperreal.org with SMTP; 3 Feb 2000 05:10:41 -0000 Received: from rcs6000 (hiper30.lnd.com [156.46.22.30]) by igs1.lnd.com (8.9.3/8.9.1) with SMTP id XAA12348 for ; Wed, 2 Feb 2000 23:10:39 -0600 From: "William A. Rowe, Jr." To: Subject: NT piped TransferLog bug (not logged, I will if you insist) Date: Wed, 2 Feb 2000 23:09:24 -0600 Message-ID: <000101bf6e05$04843bd0$345985d0@corecomm.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org Status: O Question of coding practice after forcing rotatelogs.c to work on NT: my fixup of http_log.c for both piped_log_child() and error_log_child(): { ... #if defined(WIN32) char *shellcmd; #endif ... #elif defined(WIN32) shellcmd = getenv("COMSPEC"); if (!shellcmd) return (-1); child_pid = spawnl(_P_NOWAIT, shellcmd, shellcmd, "/c", (char *)cmd, NULL); ... was failing (in 1.3.11) with simply: #elif defined(WIN32) child_pid = spawnl(P_NOWAIT, SHELL_PATH, SHELL_PATH, "/c", (char *)cmd, NULL); samewise fixup is needed in piped_log_spawn(), etc (though not where we have recoded with the CreateProcess fixup, wonder if 1/2 that issue wasn't the lack of path info)... this fixup looks ugly, but resolves CMD.EXE vs. COMMAND.COM and other discrepancies in Win32. There must be a 'more proper' way of maintaining the necessity of a dynamic command shell value vs. the static Unix macro to "/bin/sh". 1) Would an ap_shell_path() to a char* be acceptable? As far as I can tell, SHELL_PATH is used infrequently so it might be overkill. 2) Is the getenv() acceptable for host environment access, or could you point me at an internal cache of the environment that is more appropriate? 3) What about wrapping the entire junk in an ap_spawn_shell(arg0, [arg1, [,...]] NULL) wrapper? Oh, I came across this issue in rotatelogs.c as well; can we strike #define MAX_PATH 1024 and replace with _MAX_PATH in the char buf2[MAX_PATH] declaration? (Everyone has _MAX_PATH, right??? At least I tracked one down in msvc stdlib.h, which is not so standard, I know . If not, some define in ap_config.h et. al. would be good.) The only other compiler warning came from no return(0); close (not that it returns ). I'm more than happy to submit a diff'd fixup, if someone would first comment on my 3 Q's. Any suggestions on a diff for WinNT?