Tru64 Unix patch for rsync 2.5.6.

Petter Reinholdtsen pere at
Sat May 17 01:35:19 EST 2003

Version 2.5.6 of rsync fail to compile on Tru64 Unix v5.1 with this
error message:

  cc-wrapper -I. -I. -g -DHAVE_CONFIG_H  -c socket.c -o socket.o
  cc: Error: socket.c, line 619: In this statement, "sin_len" is not a
    member of "sock2". (needmember)
          sock2.sin_len = sizeof(sock2);
  make: *** [socket.o] Error 1
  error: compile failed.

The problem seem to be that configure defines HAVE_SOCKADDR_LEN if
struct sockaddr.sa_len exists, while the code uses member sin_len
instead of sa_len.  Trying to rename sin_len to sa_len did not help.
It only gave this familiar message:

  cc: Error: socket.c, line 620: In this statement, "sa_len" is not a
    member of "sock2". (needmember)
          sock2.sa_len = sizeof(sock2);
  make: *** [socket.o] Error 1

I'm not sure why sa_len is available when I test the code fragment
used in configure.  I was able to compile the problem when I manually
updated config.h to avoid defining "HAVE_SOCKADDR_LEN".

Changing the configure file to check for sin_len instead of sa_len
made the code compile without manual editing config.h.  Here is a
patch to fix the problem:

diff -ur src-2.5.6/ src-2.5.6-local/
--- src-2.5.6/      2003-01-28 06:27:40.000000000 +0100
+++ src-2.5.6-local/        2003-05-16 17:22:09.000000000 +0200
@@ -370,7 +370,7 @@

-AC_CHECK_MEMBER([struct sockaddr.sa_len],
+AC_CHECK_MEMBER([struct sockaddr.sin_len],
                [ AC_DEFINE(HAVE_SOCKADDR_LEN) ],

Using this patch the code compiled on RedHat 7.3, Tru64 Unix 5.1,
HP/UX 11.00 and 11.22, Mac OS X, AIX 5.2, Irix 6.15 and Solaris 7 and
8.  The sin_len member was missing on all of these archs.  The sa_len
member seem to only be available on Mac OS X and AIX 5.1 (based on
compile logs for v2.5.5).

Please include the patch in the next version of rsync.

More information about the rsync mailing list