delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT sources DOT redhat DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT sources DOT redhat DOT com> |
List-Help: | <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT sources DOT redhat DOT com |
Delivered-To: | mailing list cygwin AT sources DOT redhat DOT com |
Message-ID: | <3B38E535.4A8D5DAE@agilent.com> |
Date: | Tue, 26 Jun 2001 12:40:37 -0700 |
From: | Earl Chew <earl_chew AT agilent DOT com> |
Organization: | Agilent Technologies |
X-Mailer: | Mozilla 4.76 [en] (WinNT; U) |
X-Accept-Language: | en |
MIME-Version: | 1.0 |
To: | Bernard Dautrevaux <Dautrevaux AT microprocess DOT com> |
Cc: | cygwin AT cygwin DOT com, cygwin AT sources DOT redhat DOT com |
Subject: | Re: Patch: Bug: Shell fork/exec avoidance in make-3.79.1-3 |
References: | <17B78BDF120BD411B70100500422FC6309E2CE AT IIS000> |
Bernard Dautrevaux wrote: > Earl Chew wrote: > > I've included a patch below that changes all the char[] definitions > > in job.c to char*. > > I don't think that is the problem; if I look at your patch below, the > char[] definitions you change in char* are only used on AMIGA or VMS, > but *NOT* on CYGWIN... ;-( I don't think that's true. I've changed three instances of char default_shell[] to char* default_shell. 1. Pertains to AMIGA 2. Pertains to VMS 3. Pertains to those cases not covered above (ie includes Cygwin) > If you look at my previous message (posted about in paralell with > your), you'll see that just recompiling the code without any change > allow me to get a working make. I recompile make-3.79.1-3 without making any changes and observed the incorrect behaviour --- and from that incorrect behaviour figured out what the problem was. > IMHO it's just the cygwin package that was compiled in a > buggy environment. I don't think so. Here's some analysis: a. In main.c extern char* default_shell; b. In job.c There are exactly five definitions of default_shell: 1. WINDOWS32: char* default_shell = "sh.exe" 2. AMIGA: char default_shell[] = "" 3. MSDOS: char* default_shell = "command.com" 4. VMS: char default_shell[] = "" 5. else: char default_shell[] = "/bin/sh" The only definitions that might be applicable to Cygwin are [1] (WINDOWS32) or [5] (else). I'm pretty sure the WINDOWS32 case is out of the question because you can find lots of Win32 specific code in main.c that kicks in if you define this (eg #include <windows.h> ;-). That leaves [5] --- which results in a char[] definition which does not match the extern char* declaration in main.c :-( Earl -- > ---------------------------------------------------------------------+ > Earl Chew http://www.agilent.com | > Agilent Technologies mailto:earl_chew AT agilent DOT com | > Advanced Networks Division Tel: +1 604 454 3411 | > 2500-4710 Kingsway Fax: +1 604 454 3401 | > Burnaby BC V5H 4M2 Canada | > ---------------------------------------------------------------------+ --- job.c.orig Sun Mar 11 12:45:49 2001 +++ job.c Tue Jun 26 10:29:58 2001 @@ -40,7 +40,7 @@ int batch_mode_shell = 1; #else /* WINDOWS32 */ # ifdef _AMIGA -char default_shell[] = ""; +char* default_shell = ""; extern int MyExecute (char **); # else /* _AMIGA */ # ifdef __MSDOS__ @@ -52,9 +52,9 @@ # else /* __MSDOS__ */ # ifdef VMS # include <descrip.h> -char default_shell[] = ""; +char* default_shell = ""; # else -char default_shell[] = "/bin/sh"; +char* default_shell = "/bin/sh"; # endif /* VMS */ # endif /* __MSDOS__ */ int batch_mode_shell = 0; -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |