summaryrefslogtreecommitdiff
path: root/src/exec.c
Commit message (Collapse)AuthorAgeFilesLines
* (1) Layout/whitespace changes; the layout of this filefergus.henderson2009-04-101-64/+69
| | | | | | | | | | seems to have gotten mixed up when we changed from using tabs to using spaces. (2) Fix spacing in a log message. Reviewers: Craig Silverstein
* Normalize the copyright text, to the latest version of the GPLv2 textCraig Silverstein2008-05-231-9/+10
| | | | | | | | (typically the only change is in the FSF street address). Add Google copyright line in some places it was missing. Add GPLv2 notice to avahi patches. OKed by fergus
* Change C++-style // comments to /**/.Craig Silverstein2008-05-201-3/+3
| | | | | | | | | Also, fix the emacs var-setting line: it was missing a semicolon before, which means the entire line was being ignored. No contentful change. Reviewed by fergus@google.com
* Turned all tabs into 4 spaces. Got rid of whitespace at the end ofCraig Silverstein2008-05-201-173/+173
| | | | | | | | | | | | | | | | | | | | lines. Fixed up resulting mis-indented code I noticed (mostly in files that used 8 space indents, or used 4-space and 8-space indents in the same file (!)). Added the emacs tab-var setting for all files, not just some of them. I also added in copyright notices for files I noticed that didn't have them. We'll want to do another pass-through to fix these up properly, though. I used the following perl snippet to check for mis-indented code after converting tabs to whitespace: $ for i in *.{c,h}; do echo $i; perl -nle 'if ($indent > 0) {$sp=" " x $indent; /^$sp[^ ]/ && print "$.: $_"; $indent=0;}; if (/^( *).*{/ ) {$indent=length($1);} else {$indent=0;}' $i; done | less It had false positives, but hopefully didn't miss anything. Reviewed by klarlund@google.com
* There's cygwin-specific code in exec.c, but it seems to assume thatCraig Silverstein2008-05-161-24/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when running under cygwin, we'll be using a native windows app to compile. But sometimes we're using a cygwin app (eg /bin/gcc). Trying to use native-windows forking routines with cygwin apps causes a segfault (and takes a while to do it); we need to use unix forking routines there. With this change, when we're asked to spawn a sub-process, we try to guess whether the sup-process app is windows or cygwin, based on its path location (this benefits from using absolute paths): /bin/gcc vs C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe or even C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/bin/cl.exe If we decide it's a windows app but are wrong, then the windows-forking code should eventually fail with "file not found"; in that case, we fall through to the normal unix-fork case, to give cygwin a chance to find the binary. I also took the opportunity to clean up some of the code (handles should be initialized to ILLEGAL_HANDLE values, not NULL). I also replaced the crazy permissions the code was asking for before, with normal GENERIC_READ/GENERIC_WRITE. This allows the code to work when the tmpdir is c:\windows, which was failing before. Tested on cygwin using /bin/gcc as the compiler, like so: ./distcc /bin/gcc -c testtmp.c -o testtmp.o where testtmp.c is a simple "hello world" program. I also tested by running 'make check'. With this change, 'make check' passes on cygwin! (Using gcc to do compilations.) Reviewed by fergus@google.com
* We were logging a char* that could be NULL. With glibc, the printfCraig Silverstein2008-05-131-1/+4
| | | | | | | | | would just print "(null)", but on solaris libc it would segfault. Explicitly test that case now. Tested by running 'make check' on linux and solaris x86. Reviewed by klarlund@google.com and fergus@google.com
* Make handling of config.h sound.klarlund2008-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (1) Correct order of -Is in Makefile. (2) remove unnessary PATH modification in configure.ac (this is fergus's suggestion -- hopefully this will do, this replaces a circumvention mechanism I had originally concocted. (3) Fix place of the include of popt in CPPFLAGS. (4) Convert quoted includes of config.h to angle bracket includes so that the build version, not the source version, of this file is picked up. The order of -Is in the build system is wrong: it contradicts the VPATH mechanism. This means that builds in a build directory different from that of the source (distribution) directory will find wrong files even after the hapless developer has issued only a 'configure' command in the source directory (but not actually 'made' any thing there). For in that case, the src/config.h will be generated in the source directory and this will be the file picked in the build directory even if that directory has it's own src/config.h. This can lead to wrong builds and it can be hard to diagnose the problem. Currently, this what CPPFLAGS end up being (as found in the generated Makefile): CPPFLAGS = -DHAVE_CONFIG_H -D_GNU_SOURCE \ -I../distcc/popt -I../distcc/src \ ${DIR_DEFS} \ -Isrc -Ilzo \ -I"$(srcdir)/src" -I"$(srcdir)/lzo" \ Here my source dir was ../distcc. The presence of '-I../distcc/popt' in front of -Isrc is the exact opposite of the semantics of VPATH mechanism, which looks for files in the build directory, then in the source directory. Also, note the remarks in: http://www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Headers (they do not quite correctly discuss the search path, btw). TESTING: I verified that with a corrupted config.h file in the source directory, building now succeeds. Also: make distcheck (it fails the same place as before: this is corrected in another change of mine --- I'll verify that with that change in place, this change makes 'make distcheck' succeed.) REVIEWERS: fergus@google.com, csilvers@google.com
* These changes are enough to get code to compile, and at least some ofCraig Silverstein2008-04-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | the unittests to pass, on FreeBSD 6.0, Solaris 10 x86, and OS X Leopard. You have to use gmake instead of standard bsd make, though, because neither bsd nor solari make understand 'include */*.d' and 'CFLAGS += $(POPT_FLAGS).' These may be fixable later. Most changes fall into four categories: 1) #include differences 2) New errors due to some #ifdef paths being taken differently 3) Undefined functions (see, eg, the new HAVE_STRSEP) 4) Type differences (eg tv_usec is an int on os x, not a long int) As one concrete example, snprintf.c is an empty file on linux, where all the functionality is part of glibc. But on Solaris, some of its functionality is useful. This turned up a bug where if you have vsnprintf on your system but not vasnprintf, then dopr() was not being used but was being defined, leading to an "unused static function" warning in gcc. As another, solaris would complain about "index" being used as a variable, since it's also a function name. The var was renamed idx. Tested by compiling on FreeBSD, Solaris 10, and OS X leopard (x86). I also compiled and ran unittests under Linux Ubuntu, to make sure this change didn't break anything there. Reviewed by fergus@google.com
* The first step of moving everything in the distcc directory to the topCraig Silverstein2008-04-111-0/+565
level. I'm doing this in two stages, because I don't understand svn enough to be confident to do it in one. This first stage just copies all the files from distcc/FOO to FOO. Now there are two copies of each file under distcc; the Makefile/etc uses the one in distcc and ignores the one at the top level. The next commit will delete everything under distcc, and rewrite the Makefile/etc to use the top-level versions instead.