[distcc] Cygwin problem/fix

Helind helind at hem.utfors.se
Wed Feb 5 08:45:51 GMT 2003


Hi all,

I use the distcc-1.1 release and when I run a compilation on my
windows/cygwin system I encounter the following problem:
The object files returned from distccd are broken due to the CR/LF-LF
conversion made by the cygwin (text-mode) filesystem.

The following fix (src/bulk.c) solves the problem.
(The fix is only tested on windows/cygwin and not on UNIX)

Regards
Henric


diff -Naur distcc-1.1/src/bulk.c distcc-1.1-hl/src/bulk.c
--- distcc-1.1/src/bulk.c       2002-11-01 09:07:41.000000000 +0100
+++ distcc-1.1-hl/src/bulk.c    2003-02-04 16:19:33.000000000 +0100
@@ -78,7 +78,7 @@
 {
     struct stat buf;

-    *ifd = open(fname, O_RDONLY);
+    *ifd = open(fname, O_RDONLY|O_BINARY);
     if (*ifd == -1) {
         int save_errno = errno;
         if (save_errno == ENOENT) {
@@ -170,7 +170,7 @@
         return -1;
     }

-    ofd = open(filename, O_TRUNC|O_WRONLY|O_CREAT|O_EXCL, 0666);
+    ofd = open(filename, O_TRUNC|O_WRONLY|O_CREAT|O_EXCL|O_BINARY,
0666);
     if (ofd == -1) {
         rs_log_error("failed to create %s: %s", filename,
strerror(errno));
         return -1;
@@ -205,7 +205,7 @@
     int ofd, ret, close_ret;

     /* This blocks until the child starts */
-    ofd = open(fifo_name, O_WRONLY, 0600);
+    ofd = open(fifo_name, O_WRONLY|O_BINARY, 0600);
     if (ofd == -1 && errno == EINTR) {
         rs_log_notice("interrupted while opening fifo %s; perhaps
command exited without reading it?",
                       fifo_name);


More information about the distcc mailing list