diff -u distcc-3.1/config.guess distcc-3.1/config.guess --- distcc-3.1/config.guess +++ distcc-3.1/config.guess @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. -timestamp='2008-01-23' +timestamp='2009-04-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -324,6 +324,9 @@ case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; @@ -331,7 +334,20 @@ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -796,7 +812,7 @@ x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd) + EM64T | authenticamd | genuineintel) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) @@ -935,6 +951,9 @@ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -985,9 +1004,6 @@ a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. @@ -1102,8 +1118,11 @@ pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 @@ -1141,6 +1160,16 @@ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; @@ -1216,6 +1245,9 @@ BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1324,6 +1356,9 @@ i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff -u distcc-3.1/config.sub distcc-3.1/config.sub --- distcc-3.1/config.sub +++ distcc-3.1/config.sub @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. -timestamp='2008-01-16' +timestamp='2009-04-17' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -122,6 +122,7 @@ case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -249,13 +250,16 @@ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep \ + | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ - | mips64vr | mips64vrel \ + | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ @@ -268,6 +272,7 @@ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | moxie \ | mt \ | msp430 \ | nios | nios2 \ @@ -277,7 +282,7 @@ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -286,7 +291,7 @@ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) + | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) @@ -329,14 +334,17 @@ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ + | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ @@ -358,20 +366,20 @@ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ - | z8k-*) + | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) @@ -439,6 +447,10 @@ basic_machine=m68k-apollo os=-bsd ;; + aros) + basic_machine=i386-pc + os=-aros + ;; aux) basic_machine=m68k-apple os=-aux @@ -459,6 +471,10 @@ basic_machine=c90-cray os=-unicos ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -526,6 +542,10 @@ basic_machine=m88k-motorola os=-sysv3 ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp @@ -1128,6 +1148,10 @@ basic_machine=z8k-unknown os=-sim ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; none) basic_machine=none-none os=-none @@ -1166,7 +1190,7 @@ we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) @@ -1238,8 +1262,9 @@ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ + | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1248,7 +1273,7 @@ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ + | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ @@ -1388,6 +1413,9 @@ -zvmoe) os=-zvmoe ;; + -dicos*) + os=-dicos + ;; -none) ;; *) diff -u distcc-3.1/debian/changelog distcc-3.1/debian/changelog --- distcc-3.1/debian/changelog +++ distcc-3.1/debian/changelog @@ -1,3 +1,8 @@ +distcc (3.1-1~ppa10~gutsy) gutsy; urgency=low + * Updating builds for more distros, no other source changes + + -- Joe MacDonald Mon, 30 Nov 2009 16:12:43 -0500 + distcc (3.1-1~ppa9~gutsy) gutsy; urgency=low * Fixed a silly mistake in the initscript that prevented it from shutting diff -u distcc-3.1/debian/patches/02_werror_cleanup.dpatch distcc-3.1/debian/patches/02_werror_cleanup.dpatch --- distcc-3.1/debian/patches/02_werror_cleanup.dpatch +++ distcc-3.1/debian/patches/02_werror_cleanup.dpatch @@ -11,8 +11,8 @@ @DPATCH@ diff -urNad distcc-3.1~/src/dotd.c distcc-3.1/src/dotd.c --- distcc-3.1~/src/dotd.c 2008-12-02 16:50:25.000000000 -0500 -+++ distcc-3.1/src/dotd.c 2009-02-12 12:40:41.000000000 -0500 -@@ -269,10 +269,15 @@ ++++ distcc-3.1/src/dotd.c 2009-03-09 11:29:05.000000000 -0400 +@@ -269,10 +269,11 @@ *dotd_fname = tmp_dotd_fname; } else { /* There is no extension (or name ends with a "."). */ @@ -20,198 +20,178 @@ - asprintf(dotd_fname, "%s%s", tmp_dotd_fname, "d"); - else - asprintf(dotd_fname, "%s%s", tmp_dotd_fname, ".d"); -+ if (tmp_dotd_fname[strlen(tmp_dotd_fname) - 1] == '.') { -+ if (asprintf(dotd_fname, "%s%s", tmp_dotd_fname, "d") < 0) { -+ return EXIT_OUT_OF_MEMORY; -+ } -+ } else { -+ if (asprintf(dotd_fname, "%s%s", tmp_dotd_fname, ".d") < 0) { -+ return EXIT_OUT_OF_MEMORY; -+ } ++ if (asprintf(dotd_fname, "%s%s", tmp_dotd_fname, ++ ((tmp_dotd_fname[strlen(tmp_dotd_fname) - 1] == '.') ++ ? "d" : ".d" )) < 0) { ++ return EXIT_OUT_OF_MEMORY; + } if (*dotd_fname == NULL) { return EXIT_OUT_OF_MEMORY; } diff -urNad distcc-3.1~/src/emaillog.c distcc-3.1/src/emaillog.c --- distcc-3.1~/src/emaillog.c 2008-12-02 16:50:24.000000000 -0500 -+++ distcc-3.1/src/emaillog.c 2009-02-12 12:39:34.000000000 -0500 -@@ -89,15 +89,27 @@ ++++ distcc-3.1/src/emaillog.c 2009-03-09 11:29:05.000000000 -0400 +@@ -89,15 +89,15 @@ if (dcc_open_read(fname, &in_fd, &fsize)) return 1; - write(email_fileno, begin, strlen(begin)); - write(email_fileno, description, strlen(description)); - write(email_fileno, "\n", 1); -+ if (write(email_fileno, begin, strlen(begin)) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); -+ if (write(email_fileno, description, strlen(description)) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); -+ if (write(email_fileno, "\n", 1) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ dcc_writex(email_fileno, begin, strlen(begin)); ++ dcc_writex(email_fileno, description, strlen(description)); ++ dcc_writex(email_fileno, "\n", 1); dcc_pump_readwrite(email_fileno, in_fd, fsize); - write(email_fileno, end, strlen(end)); - write(email_fileno, description, strlen(description)); - write(email_fileno, "\n", 1); -+ if (write(email_fileno, end, strlen(end)) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); -+ if (write(email_fileno, description, strlen(description)) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); -+ if (write(email_fileno, "\n", 1) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ dcc_writex(email_fileno, end, strlen(end)); ++ dcc_writex(email_fileno, description, strlen(description)); ++ dcc_writex(email_fileno, "\n", 1); close(in_fd); -@@ -117,8 +129,14 @@ +@@ -117,10 +117,19 @@ if (should_send_email == 0) return; if (never_send_email) return; - asprintf(&will_send_message_to, will_send_message_format, whom_to_blame); - asprintf(&cant_send_message_to, cant_send_message_format, whom_to_blame); + if (asprintf(&will_send_message_to, will_send_message_format, -+ whom_to_blame) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ whom_to_blame) < 0) { ++ rs_log_crit("asprintf failed"); ++ return; ++ } + if (asprintf(&cant_send_message_to, cant_send_message_format, -+ whom_to_blame) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ whom_to_blame) < 0) { ++ rs_log_crit("asprintf failed"); ++ free(will_send_message_to); ++ return; ++ } - rs_log_warning(will_send_message_to); +- rs_log_warning(will_send_message_to); ++ rs_log_warning("%s", will_send_message_to); free(will_send_message_to); + + if (email_fileno < 0) { diff -urNad distcc-3.1~/src/hosts.c distcc-3.1/src/hosts.c --- distcc-3.1~/src/hosts.c 2008-12-02 16:50:24.000000000 -0500 -+++ distcc-3.1/src/hosts.c 2009-02-12 12:39:34.000000000 -0500 -@@ -171,7 +171,9 @@ ++++ distcc-3.1/src/hosts.c 2009-03-09 11:29:05.000000000 -0400 +@@ -171,7 +171,10 @@ if ((ret = dcc_get_top_dir(&top)) == 0) { /* if we failed to get it, just warn */ - asprintf(&path, "%s/hosts", top); -+ if (asprintf(&path, "%s/hosts", top) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ if (asprintf(&path, "%s/hosts", top) < 0) { ++ rs_log_crit("asprintf failed"); ++ return EXIT_OUT_OF_MEMORY; ++ } if (access(path, R_OK) == 0) { ret = dcc_parse_hosts_file(path, ret_list, ret_nhosts); free(path); -@@ -182,7 +184,9 @@ +@@ -182,7 +185,10 @@ } } - asprintf(&path, "%s/distcc/hosts", SYSCONFDIR); -+ if (asprintf(&path, "%s/distcc/hosts", SYSCONFDIR) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ if (asprintf(&path, "%s/distcc/hosts", SYSCONFDIR) < 0) { ++ rs_log_crit("asprintf failed"); ++ return EXIT_OUT_OF_MEMORY; ++ } if (access(path, R_OK) == 0) { ret = dcc_parse_hosts_file(path, ret_list, ret_nhosts); free(path); diff -urNad distcc-3.1~/src/mon-gnome.c distcc-3.1/src/mon-gnome.c --- distcc-3.1~/src/mon-gnome.c 2008-12-02 16:50:25.000000000 -0500 -+++ distcc-3.1/src/mon-gnome.c 2009-02-12 12:39:34.000000000 -0500 -@@ -651,7 +651,9 @@ ++++ distcc-3.1/src/mon-gnome.c 2009-03-09 11:29:05.000000000 -0400 +@@ -651,7 +651,8 @@ { /* We don't want to take too much time away from the real work of * compilation */ - nice(5); + if (nice(5) < 0) -+ rs_log_warning("%s failed to renice: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ rs_log_warning("failed to renice: %s\n", strerror(errno)); #if defined(WITH_GNOME) gnome_program_init ("distccmon-gnome", PACKAGE_VERSION, diff -urNad distcc-3.1~/src/mon.c distcc-3.1/src/mon.c --- distcc-3.1~/src/mon.c 2008-12-02 16:50:24.000000000 -0500 -+++ distcc-3.1/src/mon.c 2009-02-12 12:39:34.000000000 -0500 -@@ -259,7 +259,9 @@ ++++ distcc-3.1/src/mon.c 2009-03-09 11:29:05.000000000 -0400 +@@ -259,7 +259,10 @@ return 0; } - asprintf(&fullpath, "%s/%s", dirname, filename); -+ if (asprintf(&fullpath, "%s/%s", dirname, filename) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ if (asprintf(&fullpath, "%s/%s", dirname, filename) < 0) { ++ rs_log_crit("asprintf failed"); ++ return EXIT_OUT_OF_MEMORY; ++ } rs_trace("process %s", fullpath); /* Remember that the file might disappear at any time, so open it diff -urNad distcc-3.1~/src/netutil.c distcc-3.1/src/netutil.c --- distcc-3.1~/src/netutil.c 2008-12-02 16:50:24.000000000 -0500 -+++ distcc-3.1/src/netutil.c 2009-02-12 12:39:34.000000000 -0500 -@@ -177,13 +177,19 @@ ++++ distcc-3.1/src/netutil.c 2009-03-09 11:29:05.000000000 -0400 +@@ -177,13 +177,22 @@ return 0; /* it's still a valid string */ } - asprintf(p_buf, "%s:%s", host, port); -+ if (asprintf(p_buf, "%s:%s", host, port) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ if (asprintf(p_buf, "%s:%s", host, port) < 0) { ++ rs_log_crit("asprintf failed"); ++ return EXIT_OUT_OF_MEMORY; ++ } } else if (sa->sa_family == AF_UNIX) { /* NB: The word 'sun' is predefined on Solaris */ struct sockaddr_un *sa_un = (struct sockaddr_un *) sa; - asprintf(p_buf, "UNIX-DOMAIN %s", sa_un->sun_path); -+ if (asprintf(p_buf, "UNIX-DOMAIN %s", sa_un->sun_path) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ if (asprintf(p_buf, "UNIX-DOMAIN %s", sa_un->sun_path) < 0) { ++ rs_log_crit("asprintf failed"); ++ return EXIT_OUT_OF_MEMORY; ++ } } else { - asprintf(p_buf, "UNKNOWN-FAMILY %d", sa->sa_family); -+ if (asprintf(p_buf, "UNKNOWN-FAMILY %d", sa->sa_family) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ if (asprintf(p_buf, "UNKNOWN-FAMILY %d", sa->sa_family) < 0) { ++ rs_log_crit("asprintf failed"); ++ return EXIT_OUT_OF_MEMORY; ++ } } return 0; -@@ -200,14 +206,20 @@ +@@ -200,14 +209,23 @@ /* The double-cast here suppresses warnings from -Wcast-align. */ struct sockaddr_in *sain = (struct sockaddr_in *) (void *) sa; - asprintf(p_buf, "%s:%d", inet_ntoa(sain->sin_addr), - ntohs(sain->sin_port)); + if (asprintf(p_buf, "%s:%d", inet_ntoa(sain->sin_addr), -+ ntohs(sain->sin_port)) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ ntohs(sain->sin_port)) < 0) { ++ rs_log_crit("asprintf failed"); ++ return EXIT_OUT_OF_MEMORY; ++ } } else if (sa->sa_family == AF_UNIX) { /* NB: The word 'sun' is predefined on Solaris */ struct sockaddr_un *sa_un = (struct sockaddr_un *) sa; - asprintf(p_buf, "UNIX-DOMAIN %s", sa_un->sun_path); -+ if (asprintf(p_buf, "UNIX-DOMAIN %s", sa_un->sun_path) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ if (asprintf(p_buf, "UNIX-DOMAIN %s", sa_un->sun_path) < 0) { ++ rs_log_crit("asprintf failed"); ++ return EXIT_OUT_OF_MEMORY; ++ } } else { - asprintf(p_buf, "UNKNOWN-FAMILY %d", sa->sa_family); -+ if (asprintf(p_buf, "UNKNOWN-FAMILY %d", sa->sa_family) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ if (asprintf(p_buf, "UNKNOWN-FAMILY %d", sa->sa_family) < 0) { ++ rs_log_crit("asprintf failed"); ++ return EXIT_OUT_OF_MEMORY; ++ } } return 0; diff -urNad distcc-3.1~/src/serve.c distcc-3.1/src/serve.c --- distcc-3.1~/src/serve.c 2008-12-02 16:50:25.000000000 -0500 -+++ distcc-3.1/src/serve.c 2009-02-12 12:39:34.000000000 -0500 -@@ -303,7 +303,7 @@ - n = p + len; - } - if (asprintf(&buf, "%.*s/%s", len, p, compiler_name) == -1) { -- rs_log_crit("asprintf failed"); -+ rs_log_crit("asprintf failed: %s", strerror(errno)); - return EXIT_DISTCC_FAILED; - } - -@@ -362,7 +362,7 @@ - if (asprintf(&prefixed_name, "%s/%s", - root_dir, - argv[i] + j) == -1) { -- rs_log_crit("asprintf failed"); -+ rs_log_crit("asprintf failed: %s", strerror(errno)); - return EXIT_OUT_OF_MEMORY; - } - rs_trace("changed input from \"%s\" to \"%s\"", argv[i], -@@ -401,10 +401,12 @@ ++++ distcc-3.1/src/serve.c 2009-03-09 11:29:05.000000000 -0400 +@@ -401,12 +401,12 @@ if (argv[i] != NULL) { /* in case of a dangling -I */ if (argv[i][index_of_first_filename_char] == '/') { char *buf; @@ -220,152 +200,182 @@ include_option, root_dir, - argv[i] + index_of_first_filename_char); -+ argv[i] + index_of_first_filename_char) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); - if (buf == NULL) { - return EXIT_OUT_OF_MEMORY; +- if (buf == NULL) { +- return EXIT_OUT_OF_MEMORY; ++ argv[i] + index_of_first_filename_char) < 0) { ++ rs_log_crit("asprintf failed"); ++ return EXIT_OUT_OF_MEMORY; } -@@ -514,7 +516,9 @@ + free(argv[i]); + argv[i] = buf; +@@ -514,8 +514,8 @@ if ((ret = dcc_r_cwd(in_fd, client_side_cwd))) return ret; - asprintf(server_side_cwd, "%s%s", *temp_dir, *client_side_cwd); -+ if (asprintf(server_side_cwd, "%s%s", *temp_dir, *client_side_cwd)<0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); - if (*server_side_cwd == NULL) { +- if (*server_side_cwd == NULL) { ++ if (asprintf(server_side_cwd, "%s%s", *temp_dir, *client_side_cwd)<0) { ++ rs_log_crit("asprintf failed"); ret = EXIT_OUT_OF_MEMORY; } else if ((ret = dcc_mk_tmp_ancestor_dirs(*server_side_cwd))) { -@@ -744,7 +748,11 @@ + ; /* leave ret the way it is */ +@@ -744,16 +744,26 @@ dcc_stats_event(job_result); } - asprintf(&time_str, " exit:%d sig:%d core:%d ret:%d time:%dms ", WEXITSTATUS(status), WTERMSIG(status), WCOREDUMP(status), ret, time_ms); +- dcc_job_summary_append(time_str); +- free(time_str); + if (asprintf(&time_str, " exit:%d sig:%d core:%d ret:%d time:%dms ", + WEXITSTATUS(status), WTERMSIG(status), WCOREDUMP(status), -+ ret, time_ms) < 0) -+ rs_log_crit("%s: unable to update time: %s\n", __PRETTY_FUNCTION__, -+ strerror(errno)); - dcc_job_summary_append(time_str); - free(time_str); ++ ret, time_ms) < 0) { ++ rs_log_crit("unable to update time: asprintf failed"); ++ } else { ++ /* if the asprintf() failed, it's probably because it failed to ++ * allocate the target string, time_str, so none of the code in this ++ * branch of the if condition really makes sense. I don't want to ++ * update 'ret' in this case, though, because the return code from the ++ * job is still more valid than EXIT_OUT_OF_MEMORY, I think. */ ++ dcc_job_summary_append(time_str); ++ free(time_str); + +- /* append compiler and input file info */ +- if (job_result == STATS_COMPILE_ERROR +- || job_result == STATS_COMPILE_OK) { +- dcc_job_summary_append(argv[0]); +- dcc_job_summary_append(" "); +- dcc_job_summary_append(orig_input); ++ /* append compiler and input file info */ ++ if (job_result == STATS_COMPILE_ERROR ++ || job_result == STATS_COMPILE_OK) { ++ dcc_job_summary_append(argv[0]); ++ dcc_job_summary_append(" "); ++ dcc_job_summary_append(orig_input); ++ } + } + dcc_remove_log_to_file(); diff -urNad distcc-3.1~/src/srvrpc.c distcc-3.1/src/srvrpc.c --- distcc-3.1~/src/srvrpc.c 2008-12-02 16:50:24.000000000 -0500 -+++ distcc-3.1/src/srvrpc.c 2009-02-12 12:39:34.000000000 -0500 -@@ -87,7 +87,9 @@ ++++ distcc-3.1/src/srvrpc.c 2009-03-09 11:29:05.000000000 -0400 +@@ -87,9 +87,9 @@ static int prepend_dir_to_name(const char *dirname, char **path) { char *buf; - asprintf(&buf, "%s%s", dirname, *path); -+ if (asprintf(&buf, "%s%s", dirname, *path) < 0) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); - if (buf == NULL) { - return EXIT_OUT_OF_MEMORY; +- if (buf == NULL) { +- return EXIT_OUT_OF_MEMORY; ++ if (asprintf(&buf, "%s%s", dirname, *path) < 0) { ++ rs_log_crit("asprintf failed"); ++ return EXIT_OUT_OF_MEMORY; } + free(*path); + *path = buf; diff -urNad distcc-3.1~/src/stats.c distcc-3.1/src/stats.c --- distcc-3.1~/src/stats.c 2008-12-02 16:50:24.000000000 -0500 -+++ distcc-3.1/src/stats.c 2009-02-12 12:39:34.000000000 -0500 -@@ -105,7 +105,9 @@ ++++ distcc-3.1/src/stats.c 2009-03-09 11:29:22.000000000 -0400 +@@ -105,7 +105,7 @@ struct statsdata sd; memset(&sd, 0, sizeof(sd)); sd.type = e; - write(dcc_statspipe[1], &sd, sizeof(sd)); -+ if (write(dcc_statspipe[1], &sd, sizeof(sd)) < 0) -+ rs_log_warning("%s status pipe unwriteable: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ dcc_writex(dcc_statspipe[1], &sd, sizeof(sd)); } } -@@ -123,7 +125,9 @@ +@@ -123,7 +123,7 @@ sd.time = time_usec; strncpy(sd.filename, filename, MAX_FILENAME_LEN); strncpy(sd.compiler, compiler, MAX_FILENAME_LEN); - write(dcc_statspipe[1], &sd, sizeof(sd)); -+ if (write(dcc_statspipe[1], &sd, sizeof(sd)) < 0) -+ rs_log_warning("%s status pipe unwriteable: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ dcc_writex(dcc_statspipe[1], &sd, sizeof(sd)); } } -@@ -303,8 +307,12 @@ +@@ -303,8 +303,8 @@ dcc_stats.io_rate, free_space_mb); dcc_set_nonblocking(acc_fd); - read(acc_fd, challenge, 1024); /* empty the receive queue */ - write(acc_fd, reply, reply_len); -+ if (read(acc_fd, challenge, 1024) < 0) /* empty the receive queue */ -+ rs_log_warning("%s receive queue error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); -+ if (write(acc_fd, reply, reply_len) < 0) -+ rs_log_warning("%s transmit queue error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ dcc_readx(acc_fd, challenge, 1024); /* empty the receive queue */ ++ dcc_writex(acc_fd, reply, reply_len); } /* Don't think we need this to prevent RST anymore, since we read() now */ diff -urNad distcc-3.1~/src/trace.c distcc-3.1/src/trace.c --- distcc-3.1~/src/trace.c 2008-12-02 16:50:24.000000000 -0500 -+++ distcc-3.1/src/trace.c 2009-02-12 12:39:34.000000000 -0500 -@@ -327,7 +327,8 @@ ++++ distcc-3.1/src/trace.c 2009-03-09 11:29:05.000000000 -0400 +@@ -40,6 +40,7 @@ + #include + + #include "trace.h" ++#include "distcc.h" + #include "snprintf.h" + #include "va_copy.h" + +@@ -327,7 +328,7 @@ len = (int) sizeof buf - 2; strcpy(&buf[len], "\n"); - (void) write(log_fd, buf, len+1); -+ if (write(log_fd, buf, len+1) < 0) -+ rs_log_warning("rs_logger_file failure"); ++ dcc_writex(log_fd, buf, len+1); } diff -urNad distcc-3.1~/src/util.c distcc-3.1/src/util.c --- distcc-3.1~/src/util.c 2008-12-02 16:50:24.000000000 -0500 -+++ distcc-3.1/src/util.c 2009-02-12 12:39:34.000000000 -0500 -@@ -425,9 +425,11 @@ ++++ distcc-3.1/src/util.c 2009-03-09 11:29:05.000000000 -0400 +@@ -425,9 +425,15 @@ len = 0; else { #ifdef HAVE_GETCWD - getcwd(buf, sizeof buf); -+ if (!getcwd(buf, sizeof buf)) -+ return NULL; ++ if (!getcwd(buf, sizeof buf)) { ++ strcpy(buf, ""); ++ return buf; ++ } #else - getwd(buf); -+ if (!getwd(buf)) -+ return NULL; ++ if (!getwd(buf)) { ++ strcpy(buf, ""); ++ return buf; ++ } #endif len = strlen(buf); if (len >= sizeof buf) { -@@ -639,7 +641,7 @@ - FILE *f; - int reads, writes, minor; - char dev[100]; -- char tmp[1024]; -+ char tmp[1025]; - - *n_reads = 0; - *n_writes = 0; -@@ -658,7 +660,7 @@ +@@ -657,8 +663,16 @@ + kernel26 = 0; } - if (!kernel26) /* blast away 2 header lines in /proc/partitions */ +- if (!kernel26) /* blast away 2 header lines in /proc/partitions */ - fscanf(f, "%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s"); -+ retval = fscanf(f, "%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s"); ++ if (!kernel26) { /* blast away 2 header lines in /proc/partitions */ ++ char nl; ++ retval = fscanf(f, "%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s%c", &nl ); ++ if (!((retval == 1) && (nl == '\n'))) { ++ /* So either we didn't find all the header pieces we expected, or ++ * there was more header than we expected, either way we're ++ * unlikely to get accurate statistics from this point forward. */ ++ return; ++ } ++ } while (1) { if (kernel26) -@@ -689,7 +691,9 @@ +@@ -689,7 +703,8 @@ break; #endif /* assume the lines aren't longer that 1024 characters */ - fgets(tmp, 1024, f); -+ if (!fgets(tmp, 1024, f)) -+ rs_log_warning("%s unspecified error: %s\n", -+ __PRETTY_FUNCTION__, strerror(errno)); ++ if (!fgets(tmp, 1024, f) && ferror(f)) ++ rs_log_warning("fgets: error reading file"); } } diff -urNad distcc-3.1~/src/zeroconf.c distcc-3.1/src/zeroconf.c --- distcc-3.1~/src/zeroconf.c 2008-12-02 16:50:24.000000000 -0500 -+++ distcc-3.1/src/zeroconf.c 2009-02-12 12:39:34.000000000 -0500 ++++ distcc-3.1/src/zeroconf.c 2009-03-09 11:29:05.000000000 -0400 @@ -572,7 +572,8 @@ setsid(); #endif diff -u distcc-3.1/debian/patches/01_gcc_md_fixup.dpatch distcc-3.1/debian/patches/01_gcc_md_fixup.dpatch --- distcc-3.1/debian/patches/01_gcc_md_fixup.dpatch +++ distcc-3.1/debian/patches/01_gcc_md_fixup.dpatch @@ -1,20 +1,23 @@ #! /bin/sh /usr/share/dpatch/dpatch-run -## 01_gcc_md_fixup.dpatch by +## 01_gcc_md_fixup.dpatch by Joe MacDonald ## -## All lines beginning with `## DP:' are a description of the patch. -## DP: gcc's -MD option very helpfully will generate dependency files, -## DP: however they're unforunately named foo.d and the Makefile provided -## DP: by distcc then ## includes anything named foo.d. That all works fine -## DP: until you include the debian/ subdirectory which contains an -## DP: initscript named distcc.init.d, which isn't exactly Makefile-friendly. +## DP: gcc's -MD option very helpfully will generate dependency files, however +## DP: they're unforunately named foo.d and the Makefile provided by distcc +## DP: then includes anything named foo.d. That works fine until it gets +## DP: packaged by Debian, which contains a default initscript named +## DP: debian/distcc.init.d, which isn't exactly Makefile-friendly. ## ## DP: We'll just clean that up so we also use -MF with -MD and then include ## DP: something that will be less likely to live in a conflicting namespace. +## DP: I'd considered trying to explicitly exclude the debian directories, but +## DP: it seemed like kind of a hack and the better solution was to pick out +## DP: the files we wanted to include, rather than calling out a potentially +## DP: infinite list of directories we didn't want to include. @DPATCH@ diff -urNad distcc-3.1~/Makefile.in distcc-3.1/Makefile.in --- distcc-3.1~/Makefile.in 2008-12-02 16:50:31.000000000 -0500 -+++ distcc-3.1/Makefile.in 2009-02-11 11:53:16.000000000 -0500 ++++ distcc-3.1/Makefile.in 2009-03-09 08:39:30.000000000 -0400 @@ -478,7 +478,7 @@ ./config.status @@ -24,21 +27,28 @@ # Disable some warnings for popt/*.c. $(popt_OBJS): CFLAGS += $(POPT_CFLAGS) -diff -urNad distcc-3.1~/configure distcc-3.1/configure ---- distcc-3.1~/configure 2008-12-02 16:50:34.000000000 -0500 -+++ distcc-3.1/configure 2009-02-11 11:54:17.000000000 -0500 -@@ -3377,7 +3377,7 @@ - PYTHON_CFLAGS="" - if test x"$GCC" = xyes - then -- CFLAGS="$CFLAGS -MD \ -+ CFLAGS="$CFLAGS -MD -MF \$@.dep \ - -W -Wall -Wimplicit \ - -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings \ - -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes \ +@@ -901,7 +901,8 @@ + # Also clean binaries which are optionally built. Also remove .d files; old ones + # may confuse 'make'. + clean: clean-autoconf clean-lzo clean-include-server +- rm -f src/*.[od] popt/*.[od] ++ rm -f src/*.o popt/*.o ++ rm -f *.dep src/*.dep popt/*.dep + rm -f test/*.pyc + rm -f $(check_PROGRAMS) $(bin_PROGRAMS) + rm -f $(man_HTML) +@@ -914,7 +915,7 @@ + rm -f config.cache config.log + + clean-lzo: +- rm -f lzo/*.[od] lzo/testmini ++ rm -f lzo/*.o lzo/*.dep lzo/testmini + + + clean-include-server: diff -urNad distcc-3.1~/configure.ac distcc-3.1/configure.ac --- distcc-3.1~/configure.ac 2008-12-02 16:50:31.000000000 -0500 -+++ distcc-3.1/configure.ac 2009-02-11 11:53:45.000000000 -0500 ++++ distcc-3.1/configure.ac 2009-03-09 08:39:30.000000000 -0400 @@ -167,7 +167,7 @@ PYTHON_CFLAGS="" if test x"$GCC" = xyes