minaco2 / distcc

Automatically exported from code.google.com/p/distcc
GNU General Public License v2.0
0 stars 0 forks source link

Build problem of checkout r755 #98

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I ran:
./autogen.sh
./configure
make

and got this:
gcc -D_FORTIFY_SOURCE=2 -DHAVE_CONFIG_H -D_GNU_SOURCE -DSYSCONFDIR="\"/etc\"" 
-DPKGDATADIR="\"/usr/share/distcc\"" -Isrc -I"./src" -I"./lzo"  -Werror -g -O2 
-fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -MD -W 
-Wall -Wimplicit -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings 
-Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs 
-Wmissing-declarations -Wuninitialized -D_REENTRANT   -pthread -o 
src/zeroconf.o -c src/zeroconf.c
src/zeroconf.c: In function 'dcc_zeroconf_add_hosts':
src/zeroconf.c:601:18: error: ignoring return value of 'chdir', declared with 
attribute warn_unused_result [-Werror=unused-result]
cc1: all warnings being treated as errors

Original issue reported on code.google.com by thopie...@gmail.com on 4 Mar 2012 at 7:00

GoogleCodeExporter commented 9 years ago
A work-around is to configure with

  ./configure --disable-Werror

Original comment by fer...@google.com on 5 Mar 2012 at 7:02

GoogleCodeExporter commented 9 years ago
Thanks! Would be great if you could fix that by default!

Original comment by thopie...@gmail.com on 5 Mar 2012 at 7:09

GoogleCodeExporter commented 9 years ago
Here's a patch.  Can you please review it and let me know if it looks good to 
you?

Index: src/zeroconf.c
===================================================================
--- src/zeroconf.c  (revision 755)
+++ src/zeroconf.c  (working copy)
@@ -598,8 +598,11 @@
             setsid();
 #endif

-            chdir("/");
+            int ret = chdir("/");
             rs_add_logger(rs_logger_syslog, RS_LOG_DEBUG, NULL, 0);
+            if (ret != 0) {
+                rs_log_warning("chdir to '/' failed: %s", strerror(errno));
+            }
             _exit(daemon_proc(host_file, lock_file, n_slots));
         }

Original comment by fer...@google.com on 6 Mar 2012 at 6:45

GoogleCodeExporter commented 9 years ago
I went ahead and commit the patch.  Fixed in revision 757.

Original comment by fergus.h...@gmail.com on 4 Apr 2012 at 6:59

GoogleCodeExporter commented 9 years ago

Original comment by fergus.h...@gmail.com on 4 Apr 2012 at 6:59