This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Patch: Bug: Shell fork/exec avoidance in make-3.79.1-3


> -----Original Message-----
> From: Earl Chew [mailto:earl_chew@agilent.com]
> Sent: Tuesday, June 26, 2001 7:53 PM
> To: cygwin@cygwin.com; cygwin@sources.redhat.com
> Subject: Patch: Bug: Shell fork/exec avoidance in make-3.79.1-3
> 
> 
> I previously wrote:
> > Can anyone offer some advice /bin/sh avoidance with make?
> > 
> > I'm trying to figure out how to trigger make-3.79.1-3 to avoid
> > invoking /bin/sh unnecessarily.
> > 
> > I construct a makefile:
> > 
> >         all: ; sleep 15
> > 
> > Then I try:
> > 
> > bash-2.05$ make -f ../foo.mk
> > ps
> >       PID    PPID    PGID     WINPID TTY  UID    STIME COMMAND
> >       317       1     317        317  -1  500 14:59:36 /bin/bash
> >       461     317     461        549  -1  500 14:59:41 /usr/bin/make
> >       591     461     461        224  -1  500 14:59:41 /bin/sh
> >       662     591     461        585  -1  500 14:59:41 /usr/bin/ps
> 
> I eventually figured out how to rebuild make.exe, and discovered
> the problem is that main.c contains a CYGWIN LOCAL section declaring:
> 
> extern char* default_shell;
> 
> but the definition in job.c contains:
> 
> char default_shell[] = "/bin/sh";
> 
> Gack! Thus the fixup in main.c overwrites the default_shell array,
> with the result being that job.c is convinced that the default
> shell isn't the default_shell.
> 
> 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... ;-(

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 suspect your change (that does nothing on CYGWIN) is just
exercising the same behaviour. IMHO it's just the cygwin package that was
compiled in a buggy environment. 

IIRC it happens some time ago to Corinna to have a screwed-up environment
that generated a working bash that shows a bug that disapear after she
updates its environment. I suspect the make maintainer have (or had) the
same problem...

HTH,

	Bernard

> 
> Earl
> -- 
> > 
> ---------------------------------------------------------------------+
> > Earl Chew                              
http://www.agilent.com        |
> Agilent Technologies                   mailto:earl_chew@agilent.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/


--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]