- Limit the maximum block size we compute for a file.
[rsync/rsync.git] / configure.in
index 515ad25..f0ecce9 100644 (file)
@@ -5,7 +5,7 @@ AC_CONFIG_SRCDIR([byteorder.h])
 AC_CONFIG_HEADER(config.h)
 AC_PREREQ(2.52)
 
-RSYNC_VERSION=2.6.1cvs
+RSYNC_VERSION=2.6.2
 AC_SUBST(RSYNC_VERSION)
 AC_MSG_NOTICE([Configuring rsync $RSYNC_VERSION])
 
@@ -146,21 +146,26 @@ AC_TRY_RUN([
 int main(void)
 {
        struct flock lock;
-        int status;
-       int fd = open("conftest.dat", O_CREAT|O_RDWR, 0600);
+       int status;
+       char tpl[32] = "/tmp/locktest.XXXXXX";
+       int fd = mkstemp(tpl);
+       if (fd < 0) {
+               strcpy(tpl, "conftest.dat");
+               fd = open(tpl, O_CREAT|O_RDWR, 0600);
+       }
+
        lock.l_type = F_WRLCK;
        lock.l_whence = SEEK_SET;
        lock.l_start = 0;
        lock.l_len = 1;
        lock.l_pid = 0;
-       
        fcntl(fd,F_SETLK,&lock);
        if (fork() == 0) {
-               lock.l_start = 1;               
-               exit(fcntl(fd,F_SETLK,&lock) == 0);
-        }
-        wait(&status);
-       unlink("conftest.dat");
+               lock.l_start = 1;
+               _exit(fcntl(fd,F_SETLK,&lock) == 0);
+       }
+       wait(&status);
+       unlink(tpl);
        exit(WEXITSTATUS(status));
 }
 ],
@@ -279,13 +284,12 @@ AC_C_BIGENDIAN
 AC_HEADER_DIRENT
 AC_HEADER_TIME
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h unistd.h utime.h grp.h)
-AC_CHECK_HEADERS(compat.h sys/param.h ctype.h sys/wait.h sys/ioctl.h)
-AC_CHECK_HEADERS(sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h sys/un.h)
-AC_CHECK_HEADERS(glob.h mcheck.h sys/sysctl.h arpa/inet.h arpa/nameser.h)
-AC_CHECK_HEADERS(netdb.h)
-AC_CHECK_HEADERS(malloc.h)
-AC_CHECK_HEADERS(float.h)
+AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h \
+    unistd.h utime.h grp.h compat.h sys/param.h ctype.h sys/wait.h \
+    sys/ioctl.h sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h \
+    sys/un.h glob.h mcheck.h arpa/inet.h arpa/nameser.h \
+    netdb.h malloc.h float.h)
+AC_HEADER_MAJOR
 
 AC_CHECK_SIZEOF(int)
 AC_CHECK_SIZEOF(long)
@@ -388,7 +392,6 @@ else
        AC_LIBOBJ(lib/getnameinfo)
 fi
 
-
 AC_CHECK_MEMBER([struct sockaddr.sa_len],
                [ AC_DEFINE(HAVE_SOCKADDR_LEN, 1, [Do we have sockaddr.sa_len?]) ],
                [],
@@ -397,6 +400,15 @@ AC_CHECK_MEMBER([struct sockaddr.sa_len],
 #include <sys/socket.h>
 ])
 
+AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
+               [ AC_DEFINE(HAVE_SOCKADDR_IN_LEN, 1, [Do we have sockaddr_in.sin_len?]) ],
+               [],
+               [
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+])
+
 AC_MSG_CHECKING(struct sockaddr_storage)
 AC_TRY_COMPILE([#include <sys/types.h>
 #include <sys/socket.h>],