You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1997/11/29 05:42:00 UTC

[PATCH] fail gracefully if cd fails

If "cd foobar" fails for some reason in our makefiles, it will go into a
loop consuming all processes and resources... this patch fixes it.

Dean

Index: Configure
===================================================================
RCS file: /export/home/cvs/apachen/src/Configure,v
retrieving revision 1.172
diff -u -r1.172 Configure
--- Configure	1997/11/21 09:59:08	1.172
+++ Configure	1997/11/29 04:36:23
@@ -1046,7 +1046,7 @@
 default: all
 
 all clean :: 
-	for i in \$(MODULES); do (cd \$\$i; \$(MAKE) CC='\$(CC)' AUX_CFLAGS='\$(CFLAGS)' RANLIB='\$(RANLIB)' \$@) || exit 1; done
+	for i in \$(MODULES); do (cd \$\$i && \$(MAKE) CC='\$(CC)' AUX_CFLAGS='\$(CFLAGS)' RANLIB='\$(RANLIB)' \$@) || exit 1; done
 
 EOF
 
Index: Makefile.tmpl
===================================================================
RCS file: /export/home/cvs/apachen/src/Makefile.tmpl,v
retrieving revision 1.72
diff -u -r1.72 Makefile.tmpl
--- Makefile.tmpl	1997/11/15 19:04:47	1.72
+++ Makefile.tmpl	1997/11/29 04:36:23
@@ -33,7 +33,7 @@
 
 subdirs:
 	for i in $(SUBDIRS); do \
-		( cd $$i; $(MAKE) CC='$(CC)' AUX_CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)') || exit 1; \
+		( cd $$i && $(MAKE) CC='$(CC)' AUX_CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)') || exit 1; \
 	done
 
 support: support-dir
@@ -44,7 +44,7 @@
 clean:
 	rm -f $(TARGET) *.o
 	for i in $(SUBDIRS); do \
-		( cd $$i; $(MAKE) $@ ) || exit 1; \
+		( cd $$i && $(MAKE) $@ ) || exit 1; \
 	done
 
 dist.tar: